Tier 3
Series 200
200C: Radio Comms
"If the Tower (GameManager) has to call every single plane to say "Airport Closed," the radio lines jam. Instead, the Tower broadcasts one signal, and all planes listen. If your Boss AI is manually referencing the Door script AND the Sound script AND the UI script, you've created a Spiderweb."
The Concept: C# Events (Actions)
Events allow an object to shout "I Died!" without caring who is listening. This creates **Decoupled Architecture**.
* **Action:** A lightweight C# event type.
* **Subscribe (+=):** "I want to listen to this radio channel."
* **Unsubscribe (-=):** "I am turning off the radio." (Vital to prevent leaks).
* **Action:** A lightweight C# event type.
* **Subscribe (+=):** "I want to listen to this radio channel."
* **Unsubscribe (-=):** "I am turning off the radio." (Vital to prevent leaks).
Red Flag Detected
The AI Trap: "The Dependency Web"
You ask the AI: "When the boss dies, open the door and play a sound."
// 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();
}
}
This is "Hard Wiring." If you remove the Door from the scene, the Boss script crashes. The Boss shouldn't know about doors.
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 Architect's Correction
Corrective 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.
Your Pilot Command
> 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."