How hunganh7204/echoes-of-the-floating-grove works
1. This is a Unity 2D game project, not a generic app. The runtime is built around Unity scenes, prefabs, Scriptable/asset-based content, and C# MonoBehaviours under Assets/Game/_Scripts. The project uses URP 2D settings (Assets/Settings, Assets/UniversalRenderPipelineGlobalSettings.asset) and TextMesh Pro for UI text.
2. The project’s main code is split from a large amount of imported content. Game-specific scripts live in Assets/Game/_Scripts, while art/audio/UI packs and character systems are stored under Assets/Game/Assets and Assets/Game/Prefabs. This is an important boundary: most gameplay logic is custom, but most visual content is third-party asset packs.
3. Core “service” systems sit in Assets/Game/_Scripts/Core: InputManager, AudioManager, CameraFollow, DialogueManager, ScoreManager, plus interfaces like IDamageable, IInteractable, and IEnemyState. These are the shared runtime dependencies other systems use to communicate without hard-coupling every object together.
4. The player is a dedicated subsystem under Assets/Game/_Scripts/Player. PlayerController is the likely top-level coordinator, with behavior split into PlayerMovement, PlayerGravity, PlayerCombat, PlayerInteractor, PlayerStats, and echo-related classes (PlayerEcho, EchoClone). This suggests the player is composed from multiple focused components rather than one monolithic controller.
5. Enemy behavior is implemented as a state-machine architecture in Assets/Game/_Scripts/Enemy. EnemyBase is the shared foundation, while EnemyPatrolState, EnemyChaseState, EnemyAttackState, and EnemyReturnState define ground enemy phases. A parallel flying set exists (FlyingPatrolState, FlyingChaseState, FlyingAttackState, FlyingReturnState), with concrete enemy types like Eagle and Frog.
6. World and interaction logic is separated into Assets/Game/_Scripts/Environment. This includes fail/finish progression (DeadZone, FinishPoint), persistence/checkpoint-style behavior (SaveStation), rewards (TreasureChest), NPC interaction (NPCAI), and background motion (InfiniteParallax). These objects are likely driven by the player’s collision/interact flow and the shared IInteractable/IDamageable contracts.
7. Level construction has its own data flow. Assets/Game/_Scripts/Level/LevelGenerator suggests levels are assembled procedurally or from data. The data layer under Assets/Game/_Scripts/Data includes DataManager, LevelData, and PLayerData (note the capitalization), and the repository stores JSON level definitions in Assets/Resources/Levels/Level_1.json and Level_2.json. The presence of the local Newtonsoft.Json package indicates JSON serialization/deserialization is part of the runtime architecture.
8. UI is a separate subsystem under Assets/Game/_Scripts/UI. The main screens are MainMenuUI, PauseMenuUI, SettingUI, PlayerHUDUI, DialogueUI, and GameResultUI, coordinated by UIManager. This implies a centralized UI controller that switches between menu, in-game HUD, dialogue, pause, settings, and end-state screens.
9. Input, audio, and scene setup are project-level infrastructure rather than gameplay logic. The repo contains Unity input action assets (Assets/InputSystem_Actions.inputactions, Assets/Settings/PlayerControls.inputactions) and an audio mixer (Assets/Game/Audio/MainMixer.mixer). Scenes are stored in Assets/Scenes and include SampleScene.unity and Editor.unity, which likely separate gameplay from editor/test workflows.
10. There is explicit editor tooling in the repo. Assets/Game/Editor/LevelEditorManagerEditor.cs and Assets/Game/_Scripts/Edit/LevelEditorManager.cs indicate custom editor support for level authoring or inspection. This is an important architectural boundary: some functionality is intended to run inside the Unity Editor only, not in player builds.
11. The project relies heavily on prefab-driven composition. Runtime prefabs such as Player, Enemy, FlyingEnemy, NPC, FinishPoint, DeadZone, SavePointDemo, and TreasureDemo are in Assets/Game/Prefabs. This means most in-scene gameplay objects are probably assembled in the editor from reusable components, with scripts attaching behavior and assets providing visuals.
12. There are multiple imported asset packs, but they are largely content dependencies rather than core architecture. Examples include SPUM character resources, Sunny Land environments/music, Sprout Lands UI assets, and a Tiny RPG character pack. These provide animation controllers, sprites, materials, and sample scenes, but the main game architecture remains in the custom scripts and prefabs.
13. If you’re drawing an architecture diagram, the central runtime flow is: Unity scene loads → managers initialize input/audio/UI/data → player and enemies run via component-based behaviors → environment and interactables respond through shared interfaces → level data is read from JSON/resources → UI reflects gameplay state. The strongest boundaries are between core services, player/enemy logic, environment interactions, and editor/data tooling.
Main entry points: SampleScene.unity Scene Flow · PlayerController.cs Player · EnemyBase.cs Enemy AI · Player.prefab Game Prefabs
Components 20
Runtime
Core gameplay systems that run in scenes and prefabs.
- Core Services · Shared managers and contracts used across gameplay systems.
Assets/Game/_Scripts/Core - Input Manager · Central input handling and gameplay control entry point.
Assets/Game/_Scripts/Core/InputManager.cs - Audio Manager · Global audio playback and mixer-facing runtime coordination.
Assets/Game/_Scripts/Core/AudioManager.cs - UI Manager · Switches between menus, HUD, dialogue, pause, settings, and result screens.
Assets/Game/_Scripts/UI/UIManager.cs - Player · Component-based player runtime with movement, combat, interaction, stats, and echo behavior.
Assets/Game/_Scripts/Player/PlayerController.cs - Enemy AI · Ground and flying enemy behavior built from shared base logic and state objects.
Assets/Game/_Scripts/Enemy/EnemyBase.cs - Environment · Interactive world objects, progression triggers, save points, and background motion.
Assets/Game/_Scripts/Environment - Level System · Level assembly and runtime generation from authored data.
Assets/Game/_Scripts/Level/LevelGenerator.cs
Content
Imported art, audio, and reusable prefab content.
- Game Prefabs · Prefab-driven runtime assemblies for player, enemies, NPCs, hazards, and checkpoints.
Assets/Game/Prefabs/Player.prefab - Imported Art · Third-party sprite, animation, and character asset packs supporting the game.
Assets/Game/Assets/Sunny-land-files - Imported UI · External UI sprite sheets and fonts used by in-game screens and menus.
Assets/Game/Assets/Sprout Lands - UI Pack - Basic pack
Data
Level definitions and JSON-backed runtime data.
- Data Models · Runtime data objects and manager for level and player state.
Assets/Game/_Scripts/Data/DataManager.cs - Level JSON · JSON level definitions loaded through Unity Resources.
Assets/Resources/Levels/Level_1.json
Editor
Unity editor-only authoring tools.
- Level Editor · Custom Unity editor support for inspecting or authoring levels.
Assets/Game/Editor/LevelEditorManagerEditor.cs - Editor Runtime · Editor-facing level management logic separated from player builds.
Assets/Game/_Scripts/Edit/LevelEditorManager.cs
Project
Scene, render, input, and package-level configuration.
- Scene Flow · Entry scenes and scene-level composition for gameplay and editor workflows.
Assets/Scenes/SampleScene.unity - URP 2D · 2D rendering setup and project-wide render settings.
Assets/UniversalRenderPipelineGlobalSettings.asset - Input Assets · Unity input action assets used by gameplay and controls.
Assets/Settings/PlayerControls.inputactions - TextMesh Pro · Text rendering package assets and shaders used by the UI layer.
Assets/TextMesh Pro/Resources/TMP Settings.asset - Audio Mixer · Project-wide audio mix configuration used by the audio service.
Assets/Game/Audio/MainMixer.mixer
Connections 26
- Scene Flow → Core Services: initializes · Scene startup brings core runtime services online.
- Scene Flow → Player: spawns · Gameplay scenes instantiate the player prefab and controller stack.
- Scene Flow → Enemy AI: spawns · Scenes place enemy prefabs and AI state machines into the world.
- Scene Flow → Environment: hosts · Scene composition contains interactive environment objects.
- Scene Flow → Level System: loads level · Scene flow relies on level generation to build playable content.
- URP 2D → Scene Flow: renders · URP 2D settings drive how scenes are rendered.
- Input Assets → Input Manager: feeds · Input action assets are consumed by the input manager.
- Input Manager → Player: controls · Player movement and combat are driven through shared input.
- Input Manager → Enemy AI: steers · Enemy behaviors can react to player input indirectly through world state.
- Audio Manager → Audio Mixer: uses · Audio manager routes playback through the main mixer.
- UI Manager → TextMesh Pro: uses · UI screens render text through TextMesh Pro assets.
- Player → Core Services: depends on · Player components use shared services and interfaces.
- Player → Environment: interacts · Player collision and interaction drive world object behavior.
- Enemy AI → Core Services: depends on · Enemy state logic shares damage and interaction contracts.
- Enemy AI → Player: targets · Enemies chase and attack the player subsystem.
- Environment → Core Services: uses contracts · Environment objects rely on shared interactable and damageable interfaces.
- Level System → Data Models: reads data · Level generation consumes structured runtime data.
- Data Models → Level JSON: deserializes · Data manager loads level definitions from JSON resources.
- Level Editor → Editor Runtime: extends · Custom editor tooling operates on the editor-only level manager.
- Level Editor → Level System: authoring · Editor support is used to inspect or build generated levels.
- Game Prefabs → Player: assembles · Player prefab combines the player controller and supporting components.
- Game Prefabs → Enemy AI: assembles · Enemy and flying enemy prefabs package AI behaviors and visuals.
- Game Prefabs → Environment: assembles · Environment prefabs package hazards, checkpoints, rewards, and NPCs.
- Imported Art → Game Prefabs: supplies visuals · Imported character and environment packs provide art and animation content for prefabs.
- Imported UI → UI Manager: supplies ui · UI asset packs provide sprites and fonts for menus and HUD.
- Level System → Scene Flow: builds · Generated or data-driven levels are instantiated within scenes.