AI Command Lab // Flight Simulator
301C: The Mission Log
Initial AI Output (Fragile)
// AI-Generated Code: Localized and Fragile
public class HangarDoor : MonoBehaviour {
// Audit Fail: This expects a 'KeyCard' object to exist in THIS scene.
// If the player picked it up in Level 1, this script finds nothing.
public void OpenDoor() {
if (GameObject.Find("KeyCard") != null) {
Unlock();
}
}
}
Initial AI Prompt
"You ask the AI: "Check if the player has the Flight Codes to open the hangar door.""
Pilot Comm Link
Mission Objective: A skilled Pilot directs the AI to use a Global Quest Manager.
Optimized Protocol
public void OpenDoor() {
// Corrected: Checking the global state, not the local scene
if (MissionManager.Instance.IsQuestComplete("HangarKey")) {
Unlock();
} else {
Debug.Log("Flight Codes Required.");
}
}