How gamingxrelic/elephantintheroom works
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: PlayerController.cs Player Controller · Player.prefab Player · Level01.unity Level 01 · Level02.unity Level 02
Components 21
Scenes
Main runtime scenes and entry points
- Main Menu · Entry scene for menu flow
Assets/Scenes/MainMenu.unity - Level 01 · Primary gameplay scene
Assets/Scenes/Level01.unity - Level 02 · Second gameplay scene
Assets/Scenes/Level02.unity - Sample Scene · Unity default or auxiliary scene
Assets/Scenes/SampleScene.unity
Gameplay
Player control, interactions, and level progression
- Input Actions · Unity Input System action map
Assets/ElephantInTheRoom.inputactions - Player Input · Generated input wrapper used by gameplay scripts
Assets/Scripts/PlayerInputActions.cs - Player Controller · Handles player movement and control
Assets/Scripts/PlayerController.cs - Click Move · Click-to-move targeting behavior
Assets/Scripts/GoToClickPoint.cs - Interactables · Common contract for usable world objects
Assets/Scripts/InteractionObject.cs - Pickables · Common contract for carryable objects
Assets/Scripts/PickableObject.cs - Prop Interactions · Specialized interaction scripts for level props
- Next Level Door · World object that advances level completion
Assets/Scripts/NextLevelDoorInteraction.cs
UI
Menus, checklist, and pause flow
- Main Menu UI · Main menu behavior
Assets/Scripts/MainMenuLogic.cs - Pause Menu · Pause flow and state handling
Assets/Scripts/PauseMenuLogic.cs - Checklist · Checklist state and animation handlers
Assets/Scripts/ChecklistHandler.cs - Suitcase Pause · Suitcase-based pause animation logic
Assets/SuitcasePauseLogic.cs
Content
Authored prefabs, animations, and audio
- Player · Central controllable character
Assets/Objects/Player.prefab - Animations · Player, UI, and prop animator controllers and clips
Assets/Animation - Audio · Level and shared sound beds and effects
Assets/Audio - World Prefabs · Shared and level-specific interactable prefabs
Assets/Objects
Pathfinding
Imported A* navigation package
- A* Package · Imported pathfinding and navigation dependency
Assets/AstarPathfindingProject
Connections 23
- 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