Tier 4
Series 301
301A: The Global Compass
"In a long-range flight, the navigator must keep the flight plan active even when moving from one airspace (Scene) to the next. If your AI is recreating the player's inventory every time you enter a new room, you've created **Telemetry Amnesia**. A skilled Engineer audits for robust persistence logic."
The Concept: Singletons & DontDestroyOnLoad
As detailed in **Chapter 8** of our Unity 6 guide, **Singletons** ensure that a manager (like a GameController or ScoreManager) exists exactly once and persists through scene changes.
The Navigator's Advantage:
* **Continuous Telemetry:** Keep health, inventory, and fuel levels consistent between levels.
* **Centralized Control:** One point of truth for the entire flight mission.
* **Global Access:** Any ship can ask the "Global Compass" for the current objective.
The Navigator's Advantage:
* **Continuous Telemetry:** Keep health, inventory, and fuel levels consistent between levels.
* **Centralized Control:** One point of truth for the entire flight mission.
* **Global Access:** Any ship can ask the "Global Compass" for the current objective.
Red Flag Detected
The AI Trap: "The Duplicate Cockpit"
You ask the AI: "Make a ScoreManager that stays alive between scenes."
// AI-Generated Code: Dangerous and messy
public class ScoreManager : MonoBehaviour {
void Awake() {
// Audit Fail: If you return to this scene,
// a second ScoreManager will be created!
DontDestroyOnLoad(this.gameObject);
}
}
This is "Instance Overload." Each time you reload the scene, a new ScoreManager appears. Soon, you have a fleet of managers all reporting different scores. A professional pilot audits the "Awake" loop to ensure only the original commander remains in charge.
Elite Telemetry
Research shows "Elite" teams achieve 15% faster lead times by keeping AI on a "very tight leash."
- Small Batches Solving one problem at a time prevents logic drift.
- Modular Design Localizing the "blast radius" of AI changes.
- Tight Loops Rapid iteration with constant code review.
The Pilot's Correction
Corrective Protocol
public static ScoreManager Instance;
void Awake() {
if (Instance == null) {
Instance = this;
DontDestroyOnLoad(gameObject);
} else {
Destroy(gameObject); // Clear the deck of duplicates!
}
}
Your Pilot Command
> A skilled Pilot directs the AI to use a Safe Singleton Pattern.