AI Command Lab // Flight Simulator
106A: The Volatile Memory
Initial AI Output (Fragile)
// AI-Generated Code: Misunderstanding Scope public static int highScore; // Audit Fail: "static" variables persist between SCENES, // but they are still wiped when the APPLICATION closes.
Initial AI Prompt
"You ask the AI: "Make sure the score stays when I restart.""
Pilot Comm Link
Mission Objective: Direct the AI to use a Game Manager with a Singleton pattern for global state control.
Optimized Protocol
// Corrected: Disk Write
PlayerPrefs.SetInt("HighScore", score);
PlayerPrefs.Save();