# andresvinarta/theborrowedsouls architecture

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

- Interactive diagram: https://gitdiagram.com/andresvinarta/theborrowedsouls
- Repository: https://github.com/andresvinarta/theborrowedsouls

## Overview

##### Main Components
- Game Engine (Unity Runtime): Represent the core Unity engine that powers the game, including built-in systems such as the physics engine, rendering engine, audio system, and input system.
- Prefabs and Game Objects: Represent the prefabs (e.g., characters, weapons, UI elements, environmental props) housed in the Prefabs directories. These are reusable game object templates used across multiple scenes.
- Scripts / Game Logic: Group the C# scripts which implement game behavior, such as player movement, camera shaking, enemy generation, room or level management, UI control, and other gameplay mechanics.
- Assets – Models, Animations, Textures, and Sounds: Illustrate asset categories. For example, Models (in “Assets/Models”), Animations, and related controllers (in “Assets/Animations”) as well as sound effects (in “Assets/Sounds”) and visual assets (textures, fonts, videos, etc.).
- Project Settings and Configurations: Represent the Unity-specific configuration and settings (from “ProjectSettings”), which are crucial for the overall configuration of audio, input, rendering, and more.

##### Relationships and Interactions
- How the Game Engine (Unity core) orchestrates interactions between assets and scripts. Indicate that the engine consumes all game assets (Models, Animations, Textures, Sounds) and that these are instantiated in Scenes through Prefabs.

##### Architectural Patterns & Design Principles
- Unity’s GameObject-Component pattern should be emphasized. Illustrate that game objects (constructed via Prefabs) are composed of multiple components including rendering, physics, scripts, and audio.
- Separation of Concerns: Clearly differentiate the roles of assets (static content like models and sounds) from game logic (dynamic behavior implemented in scripts) and from configuration (ProjectSettings).
- Modularization: Show that the system is split into functional modules (scene management, UI, gameplay, utilities) that interact under the umbrella of the Unity engine.

##### Specify the Technologies and Frameworks
- References to Unity packages such as TextMesh Pro (for advanced text rendering) and any custom plugins (e.g. EZ Camera Shake and Mesh Optimizer).
- Folders that show usage of prefabs and assets which are integral to Unity’s component-based design.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Engine Layer
    subgraph "Core Engine"
        UE["Unity Engine Core"]:::engine
    end

    %% Scenes Layer
    subgraph "Scenes Layer"
        SC["Scene: Assets/Scenes"]:::scene
    end

    %% Prefabs Layer
    subgraph "Prefabs Layer"
        PF["Prefab: Assets/Prefabs"]:::prefab
    end

    %% Game Logic Layer
    subgraph "Game Logic"
        GS["Script: Assets/Scripts"]:::script
    end

    %% Game Assets Layer
    subgraph "Game Assets"
        AM["Model: Assets/Models"]:::asset
        AN["Animation: Assets/Animations"]:::asset
        TX["Texture: Assets/Textures"]:::asset
        SO["Sound: Assets/Sounds"]:::asset
    end

    %% External Utilities Layer
    subgraph "External Utilities"
        EC["EZ Camera Shake: Assets/EZ Camera Shake"]:::external
        MO["Mesh Optimizer: Assets/Mesh Optimizer"]:::external
    end

    %% UI System Layer
    subgraph "UI System"
        subgraph "UI Assets"
            UIF["Fonts: Assets/Fonts"]:::ui
            UII["Images: Assets/Images"]:::ui
            UITMP["TextMesh Pro: Assets/TextMesh Pro"]:::ui
        end
        UIS["UI Schema: UIElementsSchema"]:::ui
    end

    %% Connections between layers
    UE -->|"loads"| SC
    SC -->|"populates"| PF
    PF -->|"triggers"| GS
    GS -->|"fetches"| AM
    GS -->|"controls"| AN
    GS -->|"modifies"| TX
    GS -->|"activates"| SO

    %% External utilities interact with both Engine and Game Logic
    UE -->|"integrates"| EC
    UE -->|"integrates"| MO
    GS -->|"utilizes"| EC
    GS -->|"utilizes"| MO

    %% UI interactions
    UE -->|"renders"| UIF
    UE -->|"renders"| UII
    UE -->|"renders"| UITMP
    GS -->|"updates"| UIS

    %% Class Definitions for styling
    classDef engine fill:#FFCC00,stroke:#333,stroke-width:2px;
    classDef scene fill:#9FDF9F,stroke:#333,stroke-width:2px;
    classDef prefab fill:#9FC5E8,stroke:#333,stroke-width:2px;
    classDef script fill:#E06666,stroke:#333,stroke-width:2px;
    classDef asset fill:#F6B26B,stroke:#333,stroke-width:2px;
    classDef external fill:#B4A7D6,stroke:#333,stroke-width:2px;
    classDef ui fill:#6AA84F,stroke:#333,stroke-width:2px;

    %% Click Events for mapped components
    click UE "https://github.com/andresvinarta/theborrowedsouls/tree/main/ProjectSettings"
    click SC "https://github.com/andresvinarta/theborrowedsouls/tree/main/Assets/Scenes"
    click PF "https://github.com/andresvinarta/theborrowedsouls/tree/main/Assets/Prefabs"
    click GS "https://github.com/andresvinarta/theborrowedsouls/tree/main/Assets/Scripts"
    click AM "https://github.com/andresvinarta/theborrowedsouls/tree/main/Assets/Models"
    click AN "https://github.com/andresvinarta/theborrowedsouls/tree/main/Assets/Animations"
    click TX "https://github.com/andresvinarta/theborrowedsouls/tree/main/Assets/Textures"
    click SO "https://github.com/andresvinarta/theborrowedsouls/tree/main/Assets/Sounds"
    click EC "https://github.com/andresvinarta/theborrowedsouls/tree/main/Assets/EZ Camera Shake"
    click MO "https://github.com/andresvinarta/theborrowedsouls/tree/main/Assets/Mesh Optimizer"
    click UIF "https://github.com/andresvinarta/theborrowedsouls/tree/main/Assets/Fonts"
    click UII "https://github.com/andresvinarta/theborrowedsouls/tree/main/Assets/Images"
    click UITMP "https://github.com/andresvinarta/theborrowedsouls/tree/main/Assets/TextMesh Pro"
    click UIS "https://github.com/andresvinarta/theborrowedsouls/tree/main/UIElementsSchema"
```
