AI Command Lab // Flight Simulator
200C: Radio Comms
Initial AI Output (Fragile)
// AI-Generated Code: Tightly Coupled
public class Boss : MonoBehaviour {
public Door door; // Hard Reference
public Sound sound; // Hard Reference
void Die() {
door.Open();
sound.Play();
}
}
Initial AI Prompt
"You ask the AI: "When the boss dies, open the door and play a sound.""
Pilot Comm Link
Mission Objective: A skilled Architect directs the AI to Broadcast. You command: "Use a static C# Action to broadcast the death event. Let the Door decide to open itself."
Optimized Protocol
// Corrected: Modular Broadcast
public static event Action OnBossDeath;
void Die() {
// "Anyone listening? If so, tell them I died."
OnBossDeath?.Invoke();
}
// The Door script listens for this signal independently.