How kh-returngame/rg2_raisingtier works
Project Type and Purpose
• This is a Unity-based 2D game project (“Rasing Tier”) built with the Universal Render Pipeline (URP).
• It’s a physics-driven slingshot game where the player launches “tier” objects, merges them on collision, accumulates points, and tracks lives.
File-Structure Analysis
Top-level folders indicate a typical Unity layout:
• Assets/
· Scenes/ (How.unity, Main.unity, Opening.unity, Setting.unity)
· Scripts/ (ContainerBoundary.cs, GameManager.cs, GameOverPanel.cs, Launcher.cs, SceneLoader.cs, SettingsManager.cs, Tier.cs)
· Prefabs/ (Tier.prefab)
· Materials, Sprites, TextMesh Pro assets, InputSystem configurations
• Packages/ (manifest.json, packages-lock.json)
• ProjectSettings/ (Unity project settings for graphics, physics, input, URP, etc.)
• README.md
Architectural patterns:
• Single Unity executable with multiple Scenes (Opening, Main gameplay, How-to, Settings, GameOver panel overlay).
• Script components attached to GameObjects:
· Launcher: handles drag & release input.
· Tier: physics object with merge logic.
· GameManager: game state, score, lives.
· SceneLoader: scene transitions.
· SettingsManager: audio/graphics settings.
· ContainerBoundary: detect out-of-bounds and decrement lives.
Key Insights from README
• Core gameplay loop: launch → physics simulation → collision/merge → score update → lives check → game over.
• Input via Unity’s new Input System (InputSystem_Actions.inputactions).
• UI panels for score, lives, game over.
• URP2D for 2D rendering.
a. Main Components
1. Unity Engine Core (Runtime)
2. Scenes:
• Opening Scene
• Main Scene (Gameplay)
• How-To Scene
• Settings Scene
3. GameObjects & Managers:
• Launcher (Input System)
• Tier Prefab (Collider/Rigidbody2D + Tier script)
• ContainerBoundary
• GameManager
• UI Canvas (Score, Lives, GameOverPanel)
• SettingsManager
• SceneLoader
4. Asset Pipelines:
• Sprites & Materials
• TextMesh Pro subsystem
5. External/Unity Services:
• Input System Package
• URP Rendering Pipeline
b. Relationships & Interactions
• Player Input → Launcher → instantiates/forces Tier prefab into Main Scene
• Tier Prefab collides with other Tier instances → Tier.cs merges them → GameManager.UpdateScore()
• ContainerBoundary detects out-of-bounds → GameManager.LoseLife()
• GameManager monitors lives → triggers GameOverPanel UI or persists to SceneLoader
• SettingsManager reads/writes to PlayerPrefs (or equivalent) → affects AudioManager/GraphicsSettings at runtime
• SceneLoader handles menu navigation and scene transitions
c. Architectural Patterns & Principles
• Component-based architecture (Unity standard): small MonoBehaviour scripts attached to GameObjects
• Scene separation for UI/flow control
• Singletons (e.g., GameManager, SettingsManager) for global state
• Event-driven triggers (collision events, input events)
• MVC-style separation: Scripts manage logic; Prefabs/Scenes manage visuals
d. Technologies & Frameworks
• Unity 2021+ (C# MonoBehaviour)
• Universal Render Pipeline (2D Renderer)
• TextMesh Pro for UI text
• Unity Input System package
• 2D Physics (Collider2D, Rigidbody2D)
Final Advice
• Keep the Main Scene’s game loop front and center to reflect runtime flow.