public void EventPublising() { var emitter = new EventEmitter(); var listener = new MyListener(); emitter.Subscribe(listener); Assert.AreEqual(0, listener.qux); emitter.Publish(new Before <FooAction>(new FooAction())); Assert.AreEqual(FooAction.value, listener.qux); emitter.Publish(new Before <BarAction>(new BarAction())); Assert.AreEqual(BarAction.value, listener.qux); }
private void OnEnable() { Events.Subscribe(TileWorldEvents.DespawnPhysicsTile, OnDespawnPhysicsTile); }
private void OnEnable() { Events.Subscribe(ProjectileEvents.Spawn, OnSpawn); Events.Subscribe(ProjectileEvents.Despawn, OnDespawn); }