EventBus.Subscribe(Action) Method
Definition
Namespace: Brine2D.Events
Subscribes to events of type T and returns a disposal token that unsubscribes automatically when disposed. Prefer this overload to avoid stale subscriptions when scenes are unloaded:
C#
// In OnEnter:
_subscription = Game.EventBus.Subscribe<EnemyDiedEvent>(OnEnemyDied);
// In OnExit:
_subscription.Dispose();
Type parameters
T
Parameters
handler System.Action<T>
Implements Subscribe<T>\(Action<T>\)