How megabot742/surgenitro works
Purpose and Runtime
SurgeNitro is a Unity 6 (6000.0.60f1) car-racing game project. Unity scenes are the operational entry points: garage/menu flow begins in Assets/_ProjectMain/Level/Scenes/Garage.unity; race content is represented by Assets/_ProjectMain/Level/Scenes/Track1.unity, Track2.unity, and Track3.unity. Missing large resources must be restored under Assets from the README’s Google Drive archive.
Application Orchestration
Scene-level managers coordinate gameplay and presentation rather than a conventional executable main method. Race lifecycle, player setup, car display, and camera ownership are centered in:
• Assets/_ProjectMain/Code/Scripts/Manager/RaceManager.cs
• Assets/_ProjectMain/Code/Scripts/Manager/PlayerManager.cs
• Assets/_ProjectMain/Code/Scripts/Manager/CameraManager.cs
BaseManager provides a likely common manager contract at Assets/_ProjectMain/Code/Scripts/Base/BaseManager.cs. Runtime wiring is largely inspector/prefab based, including Assets/_ProjectMain/Level/Prefabs/UIManager.prefab and car prefabs.
Vehicle Simulation and Input
The core gameplay boundary is controller input → vehicle controller → wheel/physics behavior. InputCarController and mobile virtual-pad components supply controls; concrete controller modes implement arcade or realistic driving:
• Assets/_ProjectMain/Code/Scripts/Other/InputCarController.cs
• Assets/_ProjectMain/Code/Scripts/CarController/ArcadeCarController.cs
• Assets/_ProjectMain/Code/Scripts/CarController/RealisticCarController.cs
The controller hierarchy is rooted at Assets/_ProjectMain/Code/Scripts/Base/CarControllerBase.cs. Realistic simulation is decomposed into engine, transmission, nitro, turbocharger, wheel suspension, and friction updates, notably Assets/_ProjectMain/Code/Scripts/CarController/RealisticStyle/Engine.cs and Assets/_ProjectMain/Code/Scripts/Suspension/Wheel.cs.
Content, Progression, and Economy
ScriptableObjects form the static data boundary between authored content and runtime systems. Car definitions/classes, tracks, upgrades, and rewards are stored in assets and exposed through database/config types:
• Assets/_ProjectMain/Code/ScriptableObject/Car/CarDatabaseSO.cs
• Assets/_ProjectMain/Code/ScriptableObject/Track/TrackDatabaseSO.cs
• Assets/_ProjectMain/Code/ScriptableObject/Reward/RaceRewardCalculator.cs
Car prefab variants live under Assets/_ProjectMain/Level/Prefabs/Car, while PlayerCarData and UpgradeStat model per-player vehicle progression at Assets/_ProjectMain/Code/ScriptableObject/Upgrade/PlayerCarData.cs.
Race, AI, and Track Interaction
Race flow uses checkpoints/waypoints for progress and AI navigation. ChaseAI consumes waypoint topology; checkpoint checking establishes race advancement, feeding the race manager and eventual reward/result UI:
• Assets/_ProjectMain/Code/Scripts/AI/ChaseAI.cs
• Assets/_ProjectMain/Code/Scripts/AI/Waypoint/CheckPointChecker.cs
• Assets/_ProjectMain/Code/Scripts/AI/Waypoint/WaypointNode.cs
Road-material detection is a separate environmental boundary: it can alter wheel friction and select surface-specific effects through Assets/_ProjectMain/Code/Scripts/RoadDetector/RoadMaterialDetector.cs.
UI and Presentation
UIManager and UIEventManager coordinate screens, popups, overlays, and gameplay UI. The user flow covers garage, shop, upgrades, car/track selection, in-race HUD, pause, and results:
• Assets/_ProjectMain/Code/Scripts/UI/UIManager.cs
• Assets/_ProjectMain/Code/Scripts/UI/Screen/ScreenGarage.cs
• Assets/_ProjectMain/Code/Scripts/UI/Popup/PopupResult.cs
Vehicle telemetry drives decoupled audiovisual effects—engine sound, skidmarks/sounds, smoke, afterfire, lights, wind trails, and speed shaders—under Assets/_ProjectMain/Code/Scripts/Effect.
Infrastructure and External Dependencies
This is a local Unity project with no evidenced backend or online service integration. It uses Unity’s Input System asset (Assets/_ProjectMain/Level/Prefabs/CarSurgeNitro.inputactions), Universal Render Pipeline profiles for PC/mobile (Assets/_ProjectMain/Settings/PC_RPAsset.asset, Mobile_RPAsset.asset), and third-party/editor road-authoring data in EasyRoads3Dv3 and RoadArchitect. Large art resources are externally hosted on Google Drive.
Main entry points: RaceManager.cs Race manager · PlayerManager.cs Player manager · UIManager.cs UI manager · Garage.unity Garage scene
Components 22
Scenes
Unity entry points and authored race content.
- Garage scene · Menu and garage flow entry point.
Assets/_ProjectMain/Level/Scenes/Garage.unity - Race scenes · Track1, Track2, and Track3 race content.
Assets/_ProjectMain/Level/Scenes/Track1.unity
Runtime
Manager and vehicle gameplay systems.
- Base manager · Common manager contract.
Assets/_ProjectMain/Code/Scripts/Base/BaseManager.cs - Race manager · Coordinates race lifecycle and results.
Assets/_ProjectMain/Code/Scripts/Manager/RaceManager.cs - Player manager · Sets up player and selected car.
Assets/_ProjectMain/Code/Scripts/Manager/PlayerManager.cs - Camera manager · Owns gameplay camera behavior.
Assets/_ProjectMain/Code/Scripts/Manager/CameraManager.cs - Car input · Maps player and virtual-pad controls.
Assets/_ProjectMain/Code/Scripts/Other/InputCarController.cs - Car controller base · Root controller hierarchy.
Assets/_ProjectMain/Code/Scripts/Base/CarControllerBase.cs - Driving modes · Arcade and realistic controller implementations.
Assets/_ProjectMain/Code/Scripts/CarController/ArcadeCarController.cs - Realistic physics · Engine and wheel/suspension simulation.
Assets/_ProjectMain/Code/Scripts/CarController/RealisticStyle/Engine.cs
Content
Authored data, prefabs, and project dependencies.
- Car database · Authored car definitions and classes.
Assets/_ProjectMain/Code/ScriptableObject/Car/CarDatabaseSO.cs - Track database · Authored track definitions.
Assets/_ProjectMain/Code/ScriptableObject/Track/TrackDatabaseSO.cs - Car progression · Per-player car upgrades and stats.
Assets/_ProjectMain/Code/ScriptableObject/Upgrade/PlayerCarData.cs - Car prefabs · Vehicle variants wired through inspectors.
Assets/_ProjectMain/Level/Prefabs/Car - Race rewards · Calculates race rewards from authored rules.
Assets/_ProjectMain/Code/ScriptableObject/Reward/RaceRewardCalculator.cs - UI prefab · Inspector wiring for UI runtime.
Assets/_ProjectMain/Level/Prefabs/UIManager.prefab - Input actions · Input action asset.
Assets/_ProjectMain/Level/Prefabs/CarSurgeNitro.inputactions
Race Systems
Progress, AI navigation, and surface interaction.
- Checkpoint progress · Establishes race advancement.
Assets/_ProjectMain/Code/Scripts/AI/Waypoint/CheckPointChecker.cs - Chase AI · Navigates waypoint topology.
Assets/_ProjectMain/Code/Scripts/AI/ChaseAI.cs - Road material detector · Selects surface behavior and effects.
Assets/_ProjectMain/Code/Scripts/RoadDetector/RoadMaterialDetector.cs
UI & Presentation
Player-facing screens and effects.
- UI manager · Coordinates screens, popups, and gameplay UI.
Assets/_ProjectMain/Code/Scripts/UI/UIManager.cs - Result popup · Displays race outcome and rewards.
Assets/_ProjectMain/Code/Scripts/UI/Popup/PopupResult.cs
Connections 22
- Garage scene → UI manager: starts menu flow
- Garage scene → Player manager: selects car
- Race scenes → Race manager: hosts lifecycle
- Base manager → Race manager: common contract
- Base manager → Player manager: common contract
- Player manager → Car prefabs: spawns selected car
- Player manager → Car progression: loads vehicle state
- Car database → Car prefabs: defines variants
- Car input → Car controller base: supplies controls
- Input actions → Car input: input bindings
- Car controller base → Driving modes: implemented by
- Driving modes → Realistic physics: realistic mode uses
- Road material detector → Realistic physics: adjusts wheel friction
- Chase AI → Checkpoint progress: follows route
- Checkpoint progress → Race manager: reports progress
- Track database → Race scenes: selects race content
- Race manager → Race rewards: evaluates finish
- Race manager → UI manager: drives race UI
- Race rewards → Result popup: provides rewards
- UI manager → Result popup: shows results
- UI prefab → UI manager: runtime wiring
- Camera manager → Player manager: follows player