# zfergus/unity-examples architecture

> Architecture diagram of the GitHub repository zfergus/unity-examples, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zfergus/unity-examples
- Repository: https://github.com/zfergus/unity-examples

## Overview

This repository is a teaching collection of Unity examples and small games, not one integrated application. Learners explore focused projects demonstrating audio, camera techniques, touch controls, physics, materials, and game mechanics. The README documents the examples’ topics, while the tree confirms project directories and, for some examples, scripts and assets. Source excerpts were unavailable, so links between implementation components are omitted where runtime wiring cannot be verified.

Main entry points: [`AudioExample/Assets`](https://github.com/zfergus/unity-examples/tree/master/AudioExample/Assets) (Audio Examples), [`Asteroids`](https://github.com/zfergus/unity-examples/tree/master/Asteroids) (Asteroids), [`EnemyFollow/Assets/Scripts`](https://github.com/zfergus/unity-examples/tree/master/EnemyFollow/Assets/Scripts) (Enemy Follow), [`CameraExample/Assets`](https://github.com/zfergus/unity-examples/tree/master/CameraExample/Assets) (Camera Examples)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_games["Game Examples"]
  node_asteroids["Asteroids"]
  node_asteroidsplay["Ship Shooter"]
  node_invaders["Space Invaders"]
  node_tanks["Top-Down Tanks"]
  node_tank3d["Third-Person Tanks"]
  node_enemy["Enemy Follow"]
  node_enemyfollow["Target Following<br/>[MoveTowards.cs]"]
end

subgraph group_controls["Input And Camera"]
  node_camera["Camera Examples"]
  node_cameraeffects["Camera Techniques"]
  node_crossinput["Cross-Platform Input"]
  node_touchcontrols["Touch Controls"]
end

subgraph group_media["Audio Examples"]
  node_audio["Audio Examples"]
  node_sound["Sound Effects"]
  node_music["Looping Music<br/>[BackgroundMusic.cs]"]
end

subgraph group_worlds["Physics And Worlds"]
  node_gravity["GravityBox"]
  node_physics["Physics Examples"]
  node_textures["Texture Examples"]
end

subgraph group_assets["Reusable Packages"]
  node_packageworld["Standard Packages"]
  node_customprefabs["Custom Prefabs"]
end

node_learner(("Learner"))

node_learner -->|"explores"| node_asteroids
node_learner -->|"explores"| node_invaders
node_learner -->|"explores"| node_tanks
node_learner -->|"explores"| node_tank3d
node_learner -->|"explores"| node_enemy
node_learner -->|"explores"| node_audio
node_learner -->|"explores"| node_camera
node_learner -->|"explores"| node_crossinput
node_learner -->|"explores"| node_gravity
node_learner -->|"explores"| node_physics
node_learner -->|"explores"| node_textures
node_learner -->|"explores"| node_packageworld
node_learner -->|"explores"| node_customprefabs
node_asteroids -->|"demonstrates"| node_asteroidsplay
node_enemy -->|"demonstrates"| node_enemyfollow
node_audio -->|"covers"| node_sound
node_audio -->|"covers"| node_music
node_camera -->|"covers"| node_cameraeffects
node_crossinput -->|"covers"| node_touchcontrols

click node_asteroids "https://github.com/zfergus/unity-examples/tree/master/Asteroids"
click node_asteroidsplay "https://github.com/zfergus/unity-examples/tree/master/Asteroids/Assets/Scripts"
click node_invaders "https://github.com/zfergus/unity-examples/tree/master/SpaceInvaders"
click node_tanks "https://github.com/zfergus/unity-examples/tree/master/TankGame"
click node_tank3d "https://github.com/zfergus/unity-examples/tree/master/TankGame3rdPS"
click node_enemy "https://github.com/zfergus/unity-examples/tree/master/EnemyFollow/Assets/Scripts"
click node_enemyfollow "https://github.com/zfergus/unity-examples/blob/master/EnemyFollow/Assets/Scripts/MoveTowards.cs"
click node_audio "https://github.com/zfergus/unity-examples/tree/master/AudioExample/Assets"
click node_sound "https://github.com/zfergus/unity-examples/tree/master/AudioExample/Assets/Scripts"
click node_music "https://github.com/zfergus/unity-examples/blob/master/AudioExample/Assets/Scripts/BackgroundMusic.cs"
click node_camera "https://github.com/zfergus/unity-examples/tree/master/CameraExample/Assets"
click node_cameraeffects "https://github.com/zfergus/unity-examples/tree/master/CameraExample/Assets/Scenes"
click node_crossinput "https://github.com/zfergus/unity-examples/tree/master/CrossPlatformInputExample/Assets"
click node_touchcontrols "https://github.com/zfergus/unity-examples/tree/master/CrossPlatformInputExample/Assets/Scripts"
click node_gravity "https://github.com/zfergus/unity-examples/tree/master/GravityBox/Assets"
click node_physics "https://github.com/zfergus/unity-examples/tree/master/PhysicsExample"
click node_textures "https://github.com/zfergus/unity-examples/tree/master/TextureExample"
click node_packageworld "https://github.com/zfergus/unity-examples/tree/master/Packages"
click node_customprefabs "https://github.com/zfergus/unity-examples/tree/master/Packages"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_asteroids,node_asteroidsplay,node_invaders,node_tanks,node_tank3d,node_enemy,node_enemyfollow toneBlue
class node_camera,node_cameraeffects,node_crossinput,node_touchcontrols toneAmber
class node_audio,node_sound,node_music toneMint
class node_gravity,node_physics,node_textures toneRose
class node_packageworld,node_customprefabs,node_learner toneIndigo
```

## Components

### Game Examples

- [Asteroids](https://github.com/zfergus/unity-examples/tree/master/Asteroids): `Asteroids`
- [Ship Shooter](https://github.com/zfergus/unity-examples/tree/master/Asteroids/Assets/Scripts): `Asteroids/Assets/Scripts`
- [Space Invaders](https://github.com/zfergus/unity-examples/tree/master/SpaceInvaders): `SpaceInvaders`
- [Top-Down Tanks](https://github.com/zfergus/unity-examples/tree/master/TankGame): `TankGame`
- [Third-Person Tanks](https://github.com/zfergus/unity-examples/tree/master/TankGame3rdPS): `TankGame3rdPS`
- [Enemy Follow](https://github.com/zfergus/unity-examples/tree/master/EnemyFollow/Assets/Scripts): `EnemyFollow/Assets/Scripts`
- [Target Following](https://github.com/zfergus/unity-examples/blob/master/EnemyFollow/Assets/Scripts/MoveTowards.cs): `EnemyFollow/Assets/Scripts/MoveTowards.cs`

### Input And Camera

- [Camera Examples](https://github.com/zfergus/unity-examples/tree/master/CameraExample/Assets): `CameraExample/Assets`
- [Camera Techniques](https://github.com/zfergus/unity-examples/tree/master/CameraExample/Assets/Scenes): `CameraExample/Assets/Scenes`
- [Cross-Platform Input](https://github.com/zfergus/unity-examples/tree/master/CrossPlatformInputExample/Assets): `CrossPlatformInputExample/Assets`
- [Touch Controls](https://github.com/zfergus/unity-examples/tree/master/CrossPlatformInputExample/Assets/Scripts): `CrossPlatformInputExample/Assets/Scripts`

### Audio Examples

- [Audio Examples](https://github.com/zfergus/unity-examples/tree/master/AudioExample/Assets): `AudioExample/Assets`
- [Sound Effects](https://github.com/zfergus/unity-examples/tree/master/AudioExample/Assets/Scripts): `AudioExample/Assets/Scripts`
- [Looping Music](https://github.com/zfergus/unity-examples/blob/master/AudioExample/Assets/Scripts/BackgroundMusic.cs): `AudioExample/Assets/Scripts/BackgroundMusic.cs`

### Physics And Worlds

- [GravityBox](https://github.com/zfergus/unity-examples/tree/master/GravityBox/Assets): `GravityBox/Assets`
- [Physics Examples](https://github.com/zfergus/unity-examples/tree/master/PhysicsExample): `PhysicsExample`
- [Texture Examples](https://github.com/zfergus/unity-examples/tree/master/TextureExample): `TextureExample`

### Reusable Packages

- [Standard Packages](https://github.com/zfergus/unity-examples/tree/master/Packages): `Packages`
- [Custom Prefabs](https://github.com/zfergus/unity-examples/tree/master/Packages): `Packages`

### Other components

- **Learner**

## Connections

- Learner → Asteroids: explores
- Learner → Space Invaders: explores
- Learner → Top-Down Tanks: explores
- Learner → Third-Person Tanks: explores
- Learner → Enemy Follow: explores
- Learner → Audio Examples: explores
- Learner → Camera Examples: explores
- Learner → Cross-Platform Input: explores
- Learner → GravityBox: explores
- Learner → Physics Examples: explores
- Learner → Texture Examples: explores
- Learner → Standard Packages: explores
- Learner → Custom Prefabs: explores
- Asteroids → Ship Shooter: demonstrates
- Enemy Follow → Target Following: demonstrates
- Audio Examples → Sound Effects: covers
- Audio Examples → Looping Music: covers
- Camera Examples → Camera Techniques: covers
- Cross-Platform Input → Touch Controls: covers
