public WaitForEvent(GameEvent gameEvent) { _subscriberId = EventsListener.GetNextSubscriberId(); _gameEvent = gameEvent; _gameEvent.Subscribe(EventsListener.GetNextSubscriberId(), OnPublish); }
public static void UnSubscribe <TArgs1, TArgs2>(this MonoBehaviour monoBehaviour, GameEvent <TArgs1, TArgs2> gameEvent) { EventsListener eventsListener = CreateEventsListener(monoBehaviour); eventsListener.UnSubscribe(gameEvent); }
public static void Subscribe <TArgs1, TArgs2>(this MonoBehaviour monoBehaviour, GameEvent <TArgs1, TArgs2> gameEvent, Action <TArgs1, TArgs2> action) { EventsListener eventsListener = CreateEventsListener(monoBehaviour); eventsListener.Subscribe(gameEvent, action); }
public static void SubscribeWithDelay <TArgs1, TArgs2>(this MonoBehaviour monoBehaviour, GameEvent <TArgs1, TArgs2> gameEvent, Action <TArgs1, TArgs2> action, float delay) { EventsListener eventsListener = CreateEventsListener(monoBehaviour); eventsListener.SubscribeWithDelay(gameEvent, action, delay); }
public static void Subscribe(this MonoBehaviour monoBehaviour, GameEvent gameEvent, Action action) { EventsListener eventsListener = CreateEventsListener(monoBehaviour); eventsListener.Subscribe(gameEvent, action); }