# gamingxrelic/elephantintheroom architecture

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

- Interactive diagram: https://gitdiagram.com/gamingxrelic/elephantintheroom
- Repository: https://github.com/gamingxrelic/elephantintheroom

## Overview

1. **Project shape**
   - This is a **Unity game project** built around authored scenes, prefabs, animations, audio, and C# MonoBehaviours.
   - The repo is content-heavy and runtime-light: most behavior is driven by scene objects and reusable components under `Assets/Scripts`.

2. **Primary runtime scenes**
   - `Assets/Scenes/MainMenu.unity` is the entry point for menu flow.
   - `Assets/Scenes/Level01.unity` and `Assets/Scenes/Level02.unity` are the main gameplay spaces.
   - `Assets/Scenes/SampleScene.unity` appears to be a Unity default/auxiliary scene rather than core game content.

3. **Core gameplay layer**
   - The gameplay logic lives in `Assets/Scripts`, with components such as `PlayerController`, `GoToClickPoint`, `InteractionObject`, `PickableObject`, and a set of object-specific interaction scripts (`SinkInteraction`, `ToasterInteraction`, `ShowerInteraction`, `StoveInteraction`, `ToiletInteraction`, `TVTableInteraction`).
   - This suggests a component-based interaction model: generic player/object behavior plus specialized scripts per interactable prop.

4. **Player and movement flow**
   - `Player.prefab` is the central player entity.
   - `PlayerInputActions.cs` and `Assets/ElephantInTheRoom.inputactions` indicate Unity’s **Input System** is the input boundary.
   - Movement and navigation are likely split between direct player control and click-to-move/targeted movement via `GoToClickPoint`, with pathfinding support from the imported A* package.

5. **Interaction and world-object boundary**
   - Interactable world objects are grouped under `Assets/Objects`, with separate prefab families for shared items and level-specific props.
   - `InteractionObject` and `PickableObject` provide the common contract for objects that can be used or carried, while the per-object scripts implement the actual effect.
   - `JukeboxInteraction.cs` sits at the root `Assets/`, suggesting a special-case interaction that is not part of the generic object set.

6. **Level-specific content organization**
   - `Assets/Objects/Level01` contains bathroom/household props such as sink, shower, toaster, stove, toothbrush, TV, and music discs.
   - `Assets/Objects/Level02` contains a smaller separate set (`bench`, `fountain`, `stand`), implying distinct gameplay spaces with different interactive goals.
   - Shared prefabs (`Assets/Objects/Shared`) and shared audio (`Assets/Audio/Shared`) provide cross-level building blocks.

7. **UI, checklist, and pause flow**
   - UI behavior is handled by scripts such as `ChecklistHandler`, `ChecklistAnim`, `PauseMenuLogic`, `MainMenuLogic`, `SuitcasePauseLogic`, and `VolumeSettings`.
   - The presence of checklist and suitcase-specific animation assets suggests the game uses UI as a gameplay/progression surface, not just menus.
   - `NextLevelDoorInteraction` indicates level completion is tied to a world object rather than an abstract state screen.

8. **Animation subsystem**
   - Animations are organized by domain: player, sheep, appliances, UI, and level props.
   - Animator controllers exist for the player, sheep, sink, toaster, and pause UI, showing that many interactions are represented as state machines rather than scripted one-off effects.
   - Scripts such as `WalkBehindWallLogic`, `YSortController`, and `SortOrderColliderLogic` support 2D/2.5D visual layering and occlusion behavior.

9. **Audio subsystem**
   - Audio is split into `Level01`, `Level02`, and `Shared` folders, plus a `GameAudio.mixer`.
   - This indicates a clear separation between ambience/music beds and event-driven sound effects triggered by interactions like sinks, doors, footsteps, and toasters.
   - Audio is likely controlled from the same interaction scripts that drive animations and state changes.

10. **Pathfinding / AI dependency boundary**
    - The repo includes the full **A* Pathfinding Project** under `Assets/AstarPathfindingProject`.
    - That package contributes graph generation, AI movement, navmesh utilities, modifiers, and example scenes; it is architecturally separate from the game’s own scripts.
    - In this project, it likely supports click-to-move or autonomous movement behaviors rather than being the main gameplay system.

11. **Content and asset pipeline**
    - The project uses Unity-native asset types throughout: prefabs, Animator Controllers, animation clips, audio clips, materials, shaders, and TextMesh Pro resources.
    - `ProjectSettings` and `Packages` show a standard Unity package-managed setup, with the Input System and TextMesh Pro as notable runtime dependencies.

12. **What to diagram**
    - The main boxes to draw are: **Scenes**, **Player/Input**, **Interaction Scripts**, **World Prefabs**, **UI/Progression**, **Animation/Audio**, and **Pathfinding package**.
    - The key data flow is: **input → player/navigation → interaction detection → object-specific state change → animation/audio/UI update → level progression**.

Main entry points: [`Assets/Scripts/PlayerController.cs`](https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scripts/PlayerController.cs) (Player Controller), [`Assets/Objects/Player.prefab`](https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Objects/Player.prefab) (Player), [`Assets/Scenes/Level01.unity`](https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scenes/Level01.unity) (Level 01), [`Assets/Scenes/Level02.unity`](https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scenes/Level02.unity) (Level 02)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scenes["Scenes"]
  node_scene_mainmenu["Main Menu<br/>unity scene<br/>[MainMenu.unity]"]
  node_scene_level01["Level 01<br/>unity scene<br/>[Level01.unity]"]
  node_scene_level02["Level 02<br/>unity scene<br/>[Level02.unity]"]
  node_scene_sample["Sample Scene<br/>aux scene<br/>[SampleScene.unity]"]
end

subgraph group_gameplay["Gameplay"]
  node_input_actions["Input Actions<br/>input binding"]
  node_player_input["Player Input<br/>input bridge"]
  node_player_controller["Player Controller<br/>movement logic"]
  node_click_move["Click Move<br/>navigation logic<br/>[GoToClickPoint.cs]"]
  node_interaction_base["Interactables<br/>interaction base"]
  node_pickable_base["Pickables<br/>carryable base<br/>[PickableObject.cs]"]
  node_level_interactions["Prop Interactions<br/>object scripts"]
  node_next_level["Next Level Door<br/>progression trigger"]
end

subgraph group_ui["UI"]
  node_ui_mainmenu["Main Menu UI<br/>menu logic<br/>[MainMenuLogic.cs]"]
  node_ui_pause["Pause Menu<br/>pause logic<br/>[PauseMenuLogic.cs]"]
  node_ui_checklist["Checklist<br/>progress ui"]
  node_ui_suitcase["Suitcase Pause<br/>ui logic"]
end

subgraph group_content["Content"]
  node_player_prefab["Player<br/>[Player.prefab]"]
  node_anim_runtime["Animations<br/>animators"]
  node_audio_runtime["Audio"]
  node_world_prefabs[("World Prefabs<br/>scene props")]
end

subgraph group_pathfinding["Pathfinding"]
  node_astar_pkg["A* Package<br/>pathfinding package"]
end

node_scene_mainmenu -->|"drives"| node_ui_mainmenu
node_scene_level01 -->|"spawns"| node_player_prefab
node_scene_level02 -->|"spawns"| node_player_prefab
node_scene_level01 -->|"places"| node_world_prefabs
node_scene_level02 -->|"places"| node_world_prefabs
node_player_prefab -->|"uses"| node_player_controller
node_player_prefab -->|"binds"| node_player_input
node_input_actions -->|"generates"| node_player_input
node_player_input -->|"feeds"| node_player_controller
node_player_controller -->|"routes"| node_click_move
node_click_move -->|"queries"| node_astar_pkg
node_player_controller -->|"checks"| node_interaction_base
node_interaction_base -->|"specializes"| node_level_interactions
node_pickable_base -->|"specializes"| node_level_interactions
node_level_interactions -->|"triggers"| node_anim_runtime
node_level_interactions -->|"plays"| node_audio_runtime
node_ui_checklist -->|"animates"| node_anim_runtime
node_ui_pause -->|"coordinates"| node_ui_suitcase
node_ui_pause -->|"animates"| node_anim_runtime
node_ui_mainmenu -->|"plays"| node_audio_runtime
node_next_level -->|"advances"| node_scene_level02
node_scene_level01 -->|"contains"| node_next_level
node_astar_pkg -->|"supports"| node_click_move

click node_scene_mainmenu "https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scenes/MainMenu.unity"
click node_scene_level01 "https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scenes/Level01.unity"
click node_scene_level02 "https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scenes/Level02.unity"
click node_scene_sample "https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scenes/SampleScene.unity"
click node_player_prefab "https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Objects/Player.prefab"
click node_input_actions "https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/ElephantInTheRoom.inputactions"
click node_player_input "https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scripts/PlayerInputActions.cs"
click node_player_controller "https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scripts/PlayerController.cs"
click node_click_move "https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scripts/GoToClickPoint.cs"
click node_interaction_base "https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scripts/InteractionObject.cs"
click node_pickable_base "https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scripts/PickableObject.cs"
click node_ui_mainmenu "https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scripts/MainMenuLogic.cs"
click node_ui_pause "https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scripts/PauseMenuLogic.cs"
click node_ui_checklist "https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scripts/ChecklistHandler.cs"
click node_ui_suitcase "https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/SuitcasePauseLogic.cs"
click node_next_level "https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scripts/NextLevelDoorInteraction.cs"
click node_anim_runtime "https://github.com/gamingxrelic/elephantintheroom/tree/main/Assets/Animation"
click node_audio_runtime "https://github.com/gamingxrelic/elephantintheroom/tree/main/Assets/Audio"
click node_world_prefabs "https://github.com/gamingxrelic/elephantintheroom/tree/main/Assets/Objects"
click node_astar_pkg "https://github.com/gamingxrelic/elephantintheroom/tree/main/Assets/AstarPathfindingProject"

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_scene_mainmenu,node_scene_level01,node_scene_level02,node_scene_sample toneBlue
class node_input_actions,node_player_input,node_player_controller,node_click_move,node_interaction_base,node_pickable_base,node_level_interactions,node_next_level toneAmber
class node_ui_mainmenu,node_ui_pause,node_ui_checklist,node_ui_suitcase toneMint
class node_player_prefab,node_anim_runtime,node_audio_runtime,node_world_prefabs toneRose
class node_astar_pkg toneIndigo
```

## Components

### Scenes

Main runtime scenes and entry points

- [Main Menu](https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scenes/MainMenu.unity): unity scene · Entry scene for menu flow · `Assets/Scenes/MainMenu.unity`
- [Level 01](https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scenes/Level01.unity): unity scene · Primary gameplay scene · `Assets/Scenes/Level01.unity`
- [Level 02](https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scenes/Level02.unity): unity scene · Second gameplay scene · `Assets/Scenes/Level02.unity`
- [Sample Scene](https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scenes/SampleScene.unity): aux scene · Unity default or auxiliary scene · `Assets/Scenes/SampleScene.unity`

### Gameplay

Player control, interactions, and level progression

- [Input Actions](https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/ElephantInTheRoom.inputactions): input binding · Unity Input System action map · `Assets/ElephantInTheRoom.inputactions`
- [Player Input](https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scripts/PlayerInputActions.cs): input bridge · Generated input wrapper used by gameplay scripts · `Assets/Scripts/PlayerInputActions.cs`
- [Player Controller](https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scripts/PlayerController.cs): movement logic · Handles player movement and control · `Assets/Scripts/PlayerController.cs`
- [Click Move](https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scripts/GoToClickPoint.cs): navigation logic · Click-to-move targeting behavior · `Assets/Scripts/GoToClickPoint.cs`
- [Interactables](https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scripts/InteractionObject.cs): interaction base · Common contract for usable world objects · `Assets/Scripts/InteractionObject.cs`
- [Pickables](https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scripts/PickableObject.cs): carryable base · Common contract for carryable objects · `Assets/Scripts/PickableObject.cs`
- **Prop Interactions**: object scripts · Specialized interaction scripts for level props
- [Next Level Door](https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scripts/NextLevelDoorInteraction.cs): progression trigger · World object that advances level completion · `Assets/Scripts/NextLevelDoorInteraction.cs`

### UI

Menus, checklist, and pause flow

- [Main Menu UI](https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scripts/MainMenuLogic.cs): menu logic · Main menu behavior · `Assets/Scripts/MainMenuLogic.cs`
- [Pause Menu](https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scripts/PauseMenuLogic.cs): pause logic · Pause flow and state handling · `Assets/Scripts/PauseMenuLogic.cs`
- [Checklist](https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Scripts/ChecklistHandler.cs): progress ui · Checklist state and animation handlers · `Assets/Scripts/ChecklistHandler.cs`
- [Suitcase Pause](https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/SuitcasePauseLogic.cs): ui logic · Suitcase-based pause animation logic · `Assets/SuitcasePauseLogic.cs`

### Content

Authored prefabs, animations, and audio

- [Player](https://github.com/gamingxrelic/elephantintheroom/blob/main/Assets/Objects/Player.prefab): player prefab · Central controllable character · `Assets/Objects/Player.prefab`
- [Animations](https://github.com/gamingxrelic/elephantintheroom/tree/main/Assets/Animation): animators · Player, UI, and prop animator controllers and clips · `Assets/Animation`
- [Audio](https://github.com/gamingxrelic/elephantintheroom/tree/main/Assets/Audio): audio assets · Level and shared sound beds and effects · `Assets/Audio`
- [World Prefabs](https://github.com/gamingxrelic/elephantintheroom/tree/main/Assets/Objects): scene props · Shared and level-specific interactable prefabs · `Assets/Objects`

### Pathfinding

Imported A* navigation package

- [A* Package](https://github.com/gamingxrelic/elephantintheroom/tree/main/Assets/AstarPathfindingProject): pathfinding package · Imported pathfinding and navigation dependency · `Assets/AstarPathfindingProject`

## Connections

- Main Menu → Main Menu UI: drives · Main menu scene uses menu logic
- Level 01 → Player: spawns · Level 01 contains the player entity
- Level 02 → Player: spawns · Level 02 contains the player entity
- Level 01 → World Prefabs: places · Level 01 assembles interactive props
- Level 02 → World Prefabs: places · Level 02 assembles its prop set
- Player → Player Controller: uses · Player prefab is controlled by player logic
- Player → Player Input: binds · Player uses generated input wrapper
- Input Actions → Player Input: generates · Input asset defines action bindings
- Player Input → Player Controller: feeds · Input state drives movement and actions
- Player Controller → Click Move: routes · Movement can be driven by click-to-move targeting
- Click Move → A* Package: queries · Click navigation relies on pathfinding support
- Player Controller → Interactables: checks · Player movement leads into interaction detection
- Interactables → Prop Interactions: specializes · Specialized prop scripts extend the common interaction contract
- Pickables → Prop Interactions: specializes · Carryable props implement object-specific behavior
- Prop Interactions → Animations: triggers · Interactions drive prop and UI animations
- Prop Interactions → Audio: plays · Interactions trigger sound effects and ambience cues
- Checklist → Animations: animates · Checklist state is represented with animation assets
- Pause Menu → Suitcase Pause: coordinates · Pause flow includes suitcase-specific UI state
- Pause Menu → Animations: animates · Pause menu uses animator controllers and clips
- Main Menu UI → Audio: plays · Menu flow uses menu audio
- Next Level Door → Level 02: advances · Level completion can transition to the next scene
- Level 01 → Next Level Door: contains · Level 01 contains progression trigger objects
- A* Package → Click Move: supports · Imported navigation package supports player movement
