# endlizts/reindustry-project architecture

> Architecture diagram of the GitHub repository endlizts/reindustry-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/endlizts/reindustry-project
- Repository: https://github.com/endlizts/reindustry-project

## Overview

##### Project Type and Purpose
- This is a Unity-based 2D action-platformer game (“reindustry-project”) built in C#.

##### File Structure
- Top-level Unity folders:
- Assets/ (all game content and C# scripts)
- Packages/ (Unity package manifest)
- ProjectSettings/ (engine configuration)
- Under Assets/:
- Animations/, Materials/, Shaders/, Sprites/, Fonts/ – art assets
- Audios/ – sound effects & music
- Prefabs/ – reusable GameObjects (Player, Enemies, Weapons, FX, Pop-up Text)
- Scenes/ – MainMenu.unity and Game.unity (plus associated post-processing profiles)
- Scripts/ – game logic split into Actors (managers & UI controllers), Enemies (AI & spawner), Player (input & mouse-aim), Weapons (guns, bullets, melee), Utilities (health, spawner base class, destroyers)
- Settings/ – 2D render pipeline templates & URP settings

##### Extract Key Insights from README
- Single-scene Game flow powered by SceneManager
- Input → PlayerController
- Enemy spawns dynamically via EnemySpawner
- Weapons use GunData/MeleeData to drive Gun.cs/Melee.cs logic
- Animators control sprite animations per prefab
- AudioManager centralizes sound playback

##### Main Components & Their Relationships
A. Engine Core (Unity)
- Input System → feeds PlayerController
- Physics2D → collision detection between Player, Bullets, Enemies, Environment
- Animation System → Animator Controllers in Assets/Animations drive prefab animations
- Rendering (URP2D) → Materials/Shaders render Sprites
- Audio System → clips in Assets/Audios, managed by AudioManager
- Scene Management → loads MainMenu, Game, GameOver

B. Game Systems (C# Layers)
1. Game Flow
– MainMenu.cs → starts Game scene
– Gameover.cs → triggers end state
– Score.cs → UI score updates
2. Player
– PlayerController.cs (movement, double jump)
– RotateTowardMouse.cs (aiming)
– Health.cs & DamageFlash.cs (state & feedback)
3. Combat
– Gun.cs, Melee.cs → fire methods, instantiate Bullet.prefab or melee hit
– GunData/MeleeData → config ScriptableObjects (fire rate, damage)
– Bullet.cs → travel & collision logic
– MeleeHit.cs → hit detection
4. Enemies
– EnemySpawner.cs / Spawner.cs → spawn logic for MeleeEnemy.prefab or Missile.prefab
– EnemyMelee.cs, EnemyPatrol.cs, Missle.cs → AI behaviors
– Health.cs on enemies → death triggers EnemyDeathFx.prefab & score popup
5. Utilities & FX
– HitStop.cs → frame-freeze on hit
– PopupText.prefab + Text.controller → floating damage/score text
– CameraShaker (from EZ Camera Shake) → camera feedback

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Unity Engine Subsystems"
        InputSystem["Input System"]:::engine
        Physics2D["Physics2D"]:::engine
        AnimationSystem["Animation System"]:::engine
        Rendering["Rendering (URP2D)"]:::engine
        AudioSystem["Audio System"]:::engine
        SceneManagement["Scene Management"]:::engine
    end

    subgraph "Content Layer"
        Prefabs["Prefabs"]:::content
        Animations["Animations"]:::content
        Sprites["Sprites"]:::content
        AudioClips["Audio Clips"]:::content
    end

    subgraph "Game Flow Manager"
        MainMenu["MainMenu.cs"]:::module
        Gameover["Gameover.cs"]:::module
        Score["Score.cs"]:::module
        AudioManager["AudioManager.cs"]:::module
    end

    subgraph "Player Module"
        PlayerController["PlayerController.cs"]:::module
        RotateTowardMouse["RotateTowardMouse.cs"]:::module
        PlayerHealth["Health.cs"]:::module
        DamageFlash["DamageFlash.cs"]:::module
    end

    subgraph "Enemy Module"
        EnemySpawner["EnemySpawner.cs"]:::module
        EnemyMelee["EnemyMelee.cs"]:::module
        EnemyPatrol["EnemyPatrol.cs"]:::module
        MissleBehavior["Missle.cs"]:::module
        EnemyHealth["Health.cs"]:::module
    end

    subgraph "Combat & Utilities"
        Gun["Gun.cs"]:::module
        Melee["Melee.cs"]:::module
        GunData["GunData.cs"]:::module
        MeleeData["MeleeData.cs"]:::module
        Bullet["Bullet.cs"]:::module
        MeleeHit["MeleeHit.cs"]:::module
        SpawnerBase["Spawner.cs"]:::module
        DestroyAfterTime["DestroyAfterTime.cs"]:::module
        DeadPit["DeadPit.cs"]:::module
        Box["Box.cs"]:::module
        HitStop["HitStop.cs"]:::module
        PopupText["PopupText.prefab"]:::module
        CameraShaker["CameraShaker.cs"]:::module
    end

    %% Relationships
    InputSystem -->|feeds| PlayerController
    PlayerController -->|uses| Physics2D
    PlayerController -->|triggers| AnimationSystem
    PlayerController -->|calls| Gun
    PlayerController -->|calls| Melee
    Gun -->|instantiates| Bullet
    Melee -->|triggers| MeleeHit
    Bullet -->|collides| EnemyHealth
    MeleeHit -->|hits| EnemyHealth
    EnemySpawner -->|spawns| EnemyMelee
    EnemySpawner -->|spawns| MissleBehavior
    EnemyMelee -->|uses| Physics2D
    EnemyPatrol -->|uses| Physics2D
    MissleBehavior -->|uses| Physics2D
    Physics2D -->|collision events| AudioSystem
    Physics2D -->|collision events| HitStop
    EnemyHealth -->|on death| PopupText
    EnemyHealth -->|on death| Score
    MainMenu -->|loads| SceneManagement
    Gameover -->|ends| SceneManagement
    Score -->|updates UI| Prefabs
    AudioManager -->|plays clips| AudioClips

    %% Scene flow
    MainMenu -->|"Start Game"| GameScene[/"Game Scene"/]:::engine
    GameScene -->|"Game Over"| Gameover

    %% Style and classes
    classDef engine fill:#a8d0e6,stroke:#000
    classDef content fill:#f8e9a1,stroke:#000
    classDef module fill:#c1e1c1,stroke:#000

    %% Click Events
    click MainMenu "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Actors/MainMenu.cs"
    click Gameover "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Actors/Gameover.cs"
    click Score "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Actors/Score.cs"
    click AudioManager "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Actors/AudioManager.cs"
    click HitStop "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Actors/HitStop.cs"
    click PlayerController "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Player/PlayerController.cs"
    click RotateTowardMouse "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Player/RotateTowardMouse.cs"
    click PlayerHealth "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Utilities/Health.cs"
    click DamageFlash "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Utilities/DamageFlash.cs"
    click Gun "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Weapons/Gun.cs"
    click Melee "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Weapons/Melee.cs"
    click GunData "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Weapons/GunData.cs"
    click MeleeData "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Weapons/MeleeData.cs"
    click Bullet "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Weapons/Bullet.cs"
    click MeleeHit "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Weapons/MeleeHit.cs"
    click SpawnerBase "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Utilities/Spawner.cs"
    click EnemySpawner "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Enemies/EnemySpawner.cs"
    click EnemyMelee "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Enemies/EnemyMelee.cs"
    click EnemyPatrol "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Enemies/EnemyPatrol.cs"
    click MissleBehavior "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Enemies/Missle.cs"
    click DestroyAfterTime "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Utilities/DestroyAfterTime.cs"
    click DeadPit "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Utilities/DeadPit.cs"
    click Box "https://github.com/endlizts/reindustry-project/blob/main/Assets/Scripts/Utilities/Box.cs"
    click PopupText "https://github.com/endlizts/reindustry-project/blob/main/Assets/Prefabs/PopupText.prefab"
    click CameraShaker "https://github.com/endlizts/reindustry-project/blob/main/Assets/EZ Camera Shake/Scripts/CameraShaker.cs"
```
