Camera Fly-Through Controller
Purpose: Handles camera fly-through sequences for preview scenes (like CityRacing2C2, CityRacing3C3, etc.)
Key Functions:
·Creates cinematic camera movements through race tracks
·Automatically transitions between scenes after fly-through completes
·Provides visual preview of upcoming race tracks
·Integrates with CRRaceManager for proper scene flow
How it works: Moves the camera along predefined paths to show players the track they're about to race on, then loads the actual racing scene.
Race Position Tracking System
Purpose: The core race position calculation engine that determines who's winning in real-time.
Key Features:
·Multi-threaded position calculation using Unity Jobs System for performance
·Lap tracking with waypoint-based progress measurement
·Real-time position updates for all racers (player + AI)
·Race completion detection and final standings calculation
How it works:
1.Tracks each racer's progress through waypoints
2.Calculates positions based on laps completed + waypoint progress
3.Continuously updates race standings during the race
4.Provides final results when race ends
Key Methods:
·GetRacers() - Returns list of all racers and their positions
·FinalizeRacePositions() - Calculates final race results
·AreAllRacersFinished() - Checks if race is complete
·Individual Car Race Data Manager
Purpose: Attached to each car to handle individual race data, GUI display, and race completion detection.
Key Features:
·Race data tracking (position, lap times, distance traveled)
·GUI display showing position, time, speed, lap info
·Mileage tracking with persistent storage
·Race completion detection and integration with race manager
·Waypoint navigation with arrow indicators
Integration Points:
·Syncs with CRRaceManager for campaign progress
·Uses FirstSecThird for position data
·Handles individual racer finish detection
·Manages persistent car statistics
·Campaign Management System
Purpose: The master controller that manages the entire City Racing campaign across multiple scenes.
Core Responsibilities:
·Scene flow management through 15-scene campaign
·Persistent race data (positions, times, progress)
·Save/Load system for campaign progress
·Race countdown and setup coordination
·Car positioning and physics management
·Results display with manual scene transitions
Key Features:
·Singleton pattern persists across scene loads
·Manages starting grid positions based on previous race results
·Requires player input for scene transitions (no auto-loading)
·Handles different scene types (Racing, Camera, Menu, Introduction)
·Menu Interactive Game
Purpose: Interactive soccer-like mini-game in the menu system where cars can hit a ball around.
Features:
·Physics-based ball interaction with cars
·Hit tracking and statistics (height, distance, combos)
·Leaderboard system for best hits
·Menu entertainment while browsing options
·Car mileage integration with main racing system
How it works: Cars can drive around and hit a ball, with the system tracking impressive hits and maintaining records for player entertainment.
AI Navigation Points
Purpose: Individual waypoint markers that AI cars use for navigation around race tracks.
Key Properties:
·Position markers for AI pathfinding
·Speed targets for each waypoint section
·Detection radius for waypoint triggering
·Sequential navigation for lap-based racing
Integration: Used by RCC_AICarController to navigate tracks and by CRCarInfo for progress tracking.
Track Hazard System
Purpose: Track hazards that damage or slow down cars when driven over.
Features:
·Collision detection with vehicles
·Damage application to cars
·Visual/audio feedback when triggered
·Strategic placement on tracks to add challenge
How it works: When a car drives over it, applies damage or performance penalties to add variety and challenge to races.
AI Recovery System
Purpose: Detects when AI cars get stuck and automatically recovers them to maintain race flow.
Key Features:
·Stuck detection based on movement/speed analysis
·Automatic recovery by repositioning cars
·Smart placement back on track at appropriate locations
·Prevents AI deadlocks that would break races
How it works:
1.Monitors AI car movement patterns
2.Detects when cars haven't moved significantly for a period
3.Automatically teleports stuck cars back to valid track positions
4.Ensures smooth AI behavior throughout races
