Delegates & Events

Delegates and events let one part of your game announce that something happened without knowing who is listening. A health system raises OnHealthChanged, and the health bar, the hurt sound, and the screen shake each react on their own. That decoupling is what keeps a growing Unity project from turning into a tangle of direct references.

More in C# Foundations

  1. Variables & Types
  2. Control Flow & Loops
  3. Methods & Classes
  4. Collections
  5. Interfaces & Inheritance
  6. Delegates & Events

All 42 topics in the Learn Unity Roadmap