protected void Subscribe(int id, EventHandler <GameEventArgs> handler) { if (eventSubscriber == null) { eventSubscriber = EventSubscriber.Create(this); } eventSubscriber.Subscribe(id, handler); }
public static void Subscribe <T>(this GameObject obj, Action <T> func) { EventSubscriber eventSubscriber = obj.GetComponent <EventSubscriber>(); if (eventSubscriber == null) { eventSubscriber = obj.AddComponent <EventSubscriber>(); } eventSubscriber.Subscribe <T>(func); }
private void Start() { if (SpawnerType == null) { Debug.LogError("Spawner type is null, please, assign him", this); return; } if (ObjectPlaceType == null) { Debug.LogError("Object Place Type is null, please, assign him", this); return; } EventSubscriber.Subscribe(this); }
private void Start() { EventSubscriber.Subscribe(this); }
public void SubscribeEnnemyKilledEvent(EventSubscriber_EventCallback callback) { eventSubscriber.Subscribe(ennemyKilledEvent, callback); }
public void Subscribe_SendsSubscribeCommandWithGivenTopic(string topic) { _subscriber.Subscribe <Event>(topic, x => { }); _fixture.MockConnectionMultiplexer.Verify(x => x.GetSubscriber(It.IsAny <object>()), Times.Once); _fixture.MockSubscriber.Verify(x => x.Subscribe(topic, It.IsAny <Action <RedisChannel, RedisValue> >(), It.IsAny <CommandFlags>()), Times.Once); }