unity-event-bus
Unity Advanced Event Bus
This skill provides a high-performance, type-safe messaging hub for Unity projects. It is designed for developers who want to decouple systems without the overhead of ScriptableObject-based event channels.
Core Features
- Reflection Bootstrapping: Automatically finds all events and initializes buses on game load.
- Generic Performance: Uses static generic indices for O(1) event dispatch performance.
- Zero Allocation: Optimized for structs to ensure no runtime garbage collection for messages.
- Editor Safety: Auto-clears all static bindings when exiting Play Mode to prevent Editor memory leaks.
Core Files (Max 3)
EventBusCore.cs.txt: Base interfaces and the static generic bus hub.EventBusBootstrapper.cs.txt: Unity-specific auto-initialization and assembly scanning.EventBusExample.cs.txt: Practical implementation of player and system events.
Usage
Define a struct : IEvent, create an EventBinding<T>, and register it in OnEnable. Raise events from anywhere using EventBus<T>.Raise().
More from muharremtozan/unity-agent-skills
unity-so-prefab-manager
Manages the structured relationship between ScriptableObjects (Data) and Prefabs (Logic/Visuals) in Unity 6. Follows the 'SO-to-Mono' Bridge pattern to ensure instance independence (e.g., individual health for identical robots) while maintaining a clean, data-driven architecture. Use when: (1) Creating new unit/item types, (2) Wiring SO data to Prefab MonoBehaviours, (3) Resolving data-sharing bugs where changing one SO affects all instances.
16unity-fsm
Specialized skill for implementing a robust, extensible Finite State Machine in Unity using the State and Strategy patterns. Based on the pattern by Adam Myhre (3D Platformer). Use when creating complex AI, player controllers, or any system requiring structured state management.
11unity-code-reviewer
Professional Unity C# Code Reviewer. Detects anti-patterns, performance leaks, and enforces project-specific architecture.
10unity-assembly-management
Manage project boundaries using Assembly Definitions (.asmdef) for faster compile times and modular architecture. Based on the patterns by Adam Myhre. Enforces responsibility-based organization and handles Runtime/Editor/Tests splits.
9unity-ui-data-binding
Implementation of MVVM-style Data Binding for Unity UI Toolkit using the [CreateProperty] attribute and BindableProperty wrappers.
9unity-observer-pattern
Reactive Property system for Unity. Decouples data from UI and logic using observable wrappers and UnityEvents.
8