# iampaullo/gazeusbejeweled architecture

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

- Interactive diagram: https://gitdiagram.com/iampaullo/gazeusbejeweled
- Repository: https://github.com/iampaullo/gazeusbejeweled

## Overview

##### Main Components
- Unity Engine & Core Modules – The underlying Unity engine provides the runtime and scene management.
- Scenes – Your project has multiple scenes such as MainMenu, Level1, Level2, and TimedMode. Each scene represents a state or stage of the game.
- Assets – This central folder is subdivided into:
- Art – Contains animations (e.g., Fade, Gems), menus, FX, and sprite sheets.
- Prefabs – Pre-configured GameObjects, including canvases and in-game elements such as InGame Managers (SceneManager, ScoreManager, SoundManager) and game items (gems, placeholders).
- Scripts – Contains all the C# scripts controlling game logic (e.g., Board.cs, GemManager.cs, MatchHandler.cs, TimerHandler.cs, etc.). These scripts encapsulate the game’s rules, interactions, and behaviors.
- Sounds – Audio files (.mp3, .wav) for background music and sound effects.
- TextMesh Pro – Provided as a typical Unity package for advanced text rendering.
- Project Settings & Packages – These directories store configuration, project versioning, and package dependencies. They are important for understanding deployment and integration with Unity's services.

##### Architectural Patterns and Interactions
- Component-Based Architecture – The game relies on Unity’s paradigm where behavior is attached to GameObjects through components (scripts, animations, controllers). For instance, each prefab (like a gem or background music manager) encapsulates functionality that is linked via scripts.
- Scene Management – The Scenes folder and the SceneManager prefab/script indicate a clear division between game states (e.g., main menu vs. gameplay).
- Manager Classes – Managers for score, sound, and board (e.g., ScoreManager.cs, SoundManager.cs, and Board.cs) suggest a centralized design to handle respective game logic, making the architecture modular.
- Asset Pipeline – The distinct folders for Art, Sounds, and Prefabs illustrate how assets are organized and later referenced by scripts during runtime.
- Animation & UI Flow – The Art folder’s structure (with Anim and Menus) shows dedicated components for handling transitions and animations which are likely tied to UI prefabs and controllers.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Global Components
    UE["Unity Engine"]:::engine
    PS["Project Settings"]:::settings
    UE -->|"provides"| PS

    %% Game Scenes Subgraph
    subgraph "Game Scenes"
        SM["MainMenu Scene"]:::scene
        L1["Level1 Scene"]:::scene
        L2["Level2 Scene"]:::scene
        TM["TimedMode Scene"]:::scene
    end
    UE -->|"loads"| SM
    SM -->|"transitionsTo"| L1
    SM -->|"transitionsTo"| L2
    SM -->|"transitionsTo"| TM

    %% Manager Components Subgraph
    subgraph "Manager Components"
        SMgr["SceneManager"]:::manager
        SCMgr["ScoreManager"]:::manager
        SOUMgr["SoundManager"]:::manager
        BMMgr["BackgroundMusic Manager"]:::manager
    end
    SM -->|"triggers"| SMgr
    SMgr -->|"manages"| SM["MainMenu Scene"]
    SMgr -->|"controls"| Board
    SMgr -->|"controls"| SceneScript
    SCMgr -->|"handles"| ScoreScript
    SOUMgr -->|"handles"| SoundScript
    BMMgr -->|"handles"| BMScript

    %% Assets Subgraph
    subgraph "Game Assets"
        %% Art Assets Subgraph
        subgraph "Art Assets"
            An["Animations"]:::art
            Me["Menus"]:::art
            FX["FX"]:::art
            SS["Sprite Sheets"]:::art
        end
        %% Prefabs Subgraph
        subgraph "Prefabs"
            UICanvas["Canvas"]:::prefab
            UICanvasMenu["CanvasMenu"]:::prefab
            UICanvasTimed["Canvas Timed"]:::prefab
            Gems["InGame Gems"]:::prefab
            Placeholders["Placeholders"]:::prefab
        end
        %% Scripts Subgraph
        subgraph "Scripts"
            Board["Board.cs"]:::script
            GemMan["GemManager.cs"]:::script
            Match["MatchHandler.cs"]:::script
            Timer["TimerHandler.cs"]:::script
            Progress["ProgressBarHandler.cs"]:::script
            SoundBoard["SoundBoard.cs"]:::script
            SoundSlider["SoundSlider.cs"]:::script
            Mute["MuteManager.cs"]:::script
            Camera["CameraReSizer.cs"]:::script
            SceneScript["ScenesManager.cs"]:::script
            ScoreScript["ScoreManager.cs"]:::script
            SoundScript["SoundManager.cs"]:::script
            BMScript["BackgroundMusic.cs"]:::script
        end
    end

    %% Audio Assets Subgraph
    subgraph "Audio Assets"
        Sounds["Sounds"]:::audio
    end

    %% Text Rendering
    TMP["TextMesh Pro"]:::text

    %% Relationships between Assets and other components
    UICanvas -->|"rendersText"| TMP
    UICanvasMenu -->|"rendersText"| TMP
    UICanvasTimed -->|"rendersText"| TMP

    Gems -->|"usesAnimation"| An
    Gems -->|"bindsScript"| GemMan
    GemMan -->|"triggersLogic"| Match

    Board -->|"coordinates"| GemMan

    %% Connections between Manager Scripts and Game Logic Scripts
    SMgr -->|"invokes"| Board
    SCMgr -->|"updates"| ScoreScript
    SOUMgr -->|"invokes"| SoundScript
    BMMgr -->|"invokes"| BMScript

    %% Audio connections
    SoundScript -->|"plays"| Sounds
    BMScript -->|"plays"| Sounds

    %% Additional game logic connections
    Timer -->|"tracksTime"| Board
    Progress -->|"updatesProgress"| Timer

    %% Styles
    classDef engine fill:#f9e79f,stroke:#b9770e,stroke-width:2px;
    classDef settings fill:#fcf3cf,stroke:#b7950b,stroke-width:2px;
    classDef scene fill:#aed6f1,stroke:#2471a3,stroke-width:2px;
    classDef manager fill:#d5f5e3,stroke:#27ae60,stroke-width:2px;
    classDef art fill:#fadbd8,stroke:#e74c3c,stroke-width:2px;
    classDef prefab fill:#d6eaf8,stroke:#2e86c1,stroke-width:2px;
    classDef script fill:#fcf3cf,stroke:#f1c40f,stroke-width:2px;
    classDef audio fill:#f9ebea,stroke:#e74c3c,stroke-width:2px;
    classDef text fill:#e8daef,stroke:#8e44ad,stroke-width:2px;

    %% Click Events
    click PS "https://github.com/iampaullo/gazeusbejeweled/tree/main/ProjectSettings/"
    click SM "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Scenes/MainMenu.unity"
    click L1 "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Scenes/Level1.unity"
    click L2 "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Scenes/Level2.unity"
    click TM "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Scenes/TimedMode.unity"
    click An "https://github.com/iampaullo/gazeusbejeweled/tree/main/Assets/Art/Anim"
    click Me "https://github.com/iampaullo/gazeusbejeweled/tree/main/Assets/Art/Menus"
    click FX "https://github.com/iampaullo/gazeusbejeweled/tree/main/Assets/Art/FX"
    click SS "https://github.com/iampaullo/gazeusbejeweled/tree/main/Assets/Art/SpriteSheets"
    click UICanvas "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Prefabs/Canvas.prefab"
    click UICanvasMenu "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Prefabs/CanvasMenu.prefab"
    click UICanvasTimed "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Prefabs/Canvas Timed.prefab"
    click Gems "https://github.com/iampaullo/gazeusbejeweled/tree/main/Assets/Prefabs/InGame"
    click Placeholders "https://github.com/iampaullo/gazeusbejeweled/tree/main/Assets/Prefabs/PlaceHolder"
    click SMgr "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Prefabs/InGame/Managers/SceneManager.prefab"
    click SCMgr "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Prefabs/InGame/Managers/ScoreManager.prefab"
    click SOUMgr "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Prefabs/InGame/Managers/SoundManager.prefab"
    click BMMgr "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Prefabs/InGame/Managers/BackgroundMusic.prefab"
    click SceneScript "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Scripts/ScenesManager.cs"
    click ScoreScript "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Scripts/ScoreManager.cs"
    click SoundScript "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Scripts/SoundManager.cs"
    click BMScript "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Scripts/BackgroundMusic.cs"
    click Board "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Scripts/Board.cs"
    click GemMan "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Scripts/GemManager.cs"
    click Match "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Scripts/MatchHandler.cs"
    click Timer "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Scripts/TimerHandler.cs"
    click Progress "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Scripts/ProgressBarHandler.cs"
    click SoundBoard "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Scripts/SoundBoard.cs"
    click SoundSlider "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Scripts/SoundSlider.cs"
    click Mute "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Scripts/MuteManager.cs"
    click Camera "https://github.com/iampaullo/gazeusbejeweled/blob/main/Assets/Scripts/CameraReSizer.cs"
    click Sounds "https://github.com/iampaullo/gazeusbejeweled/tree/main/Assets/Sounds"
    click TMP "https://github.com/iampaullo/gazeusbejeweled/tree/main/Assets/TextMesh Pro"
```
