event-systems

Design decoupled Unity event communication patterns with lifecycle-safe subscriptions.

3|Updated Jun 27, 2026
One-click install
npx skills add https://github.com/OmerZeyveli/kinglet-unity --skill event-systems-omerzeyveli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: event-systems
Source: https://github.com/OmerZeyveli/kinglet-unity/tree/main/.claude/skills/core/event-systems
Command: npx skills add https://github.com/OmerZeyveli/kinglet-unity --skill event-systems-omerzeyveli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps Unity developers connect systems without creating rigid dependencies, while preventing memory leaks and unintended event behavior.

Core Features & Use Cases

  • C# Event Patterns: Use typed events and actions for efficient communication between related classes.
  • Unity Event Architectures: Select appropriate patterns for UnityEvent, ScriptableObject event channels, and static event buses.
  • Lifecycle Safety: Subscribe and unsubscribe symmetrically to handle disabled objects, destruction, and scene unloading.
  • Performance Guidance: Apply zero-allocation approaches for high-frequency event paths and avoid unnecessary event abstractions.

Quick Start

Use the event-systems skill to design a decoupled Unity health notification flow with safe subscription and unsubscription handling.

Frequently Asked Questions about event-systems

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent memory leaks in Unity event subscriptions?

Prevent memory leaks in Unity event subscriptions by enforcing symmetric subscribe and unsubscribe calls. This ensures disabled objects, destroyed GameObjects, and unloaded scenes properly detach listeners, avoiding dangling references and unintended event behavior.

What is the best way to decouple Unity systems for high-frequency gameplay communication?

The best way to decouple Unity systems for high-frequency gameplay communication is using zero-allocation event architectures. Typed C# events and static event buses minimize garbage collection overhead compared to heavy abstractions.

When should I use ScriptableObject event channels versus C# events in Unity?

Use ScriptableObject event channels when communicating between unrelated systems that should not reference each other directly. Use C# events for efficient communication between closely related classes where slight coupling is acceptable.

Why does my UnityEvent still fire after the target object is disabled?

Your UnityEvent fires after the target object is disabled because the subscription was not properly managed during the lifecycle. Implementing lifecycle-safe subscription management ensures listeners are detached when objects are disabled or destroyed.

Can I use static event buses for decoupled communication across unloaded Unity scenes?

You can use static event buses across unloaded Unity scenes, but it requires strict lifecycle-safe subscription management. If listeners do not unsubscribe symmetrically during scene unloading, static buses will retain dangling references and cause memory leaks.

Do I need to avoid UnityEvent abstractions for performance-critical event paths?

You need to avoid UnityEvent abstractions for performance-critical event paths because they generate unnecessary allocations. Applying zero-allocation approaches with typed C# events prevents garbage collection spikes during high-frequency gameplay communication.