コード例 #1
0
ファイル: WaitForEvent.cs プロジェクト: yazici/unity-utils
 public WaitForEvent(GameEvent gameEvent)
 {
     _subscriberId = EventsListener.GetNextSubscriberId();
     _gameEvent    = gameEvent;
     _gameEvent.Subscribe(EventsListener.GetNextSubscriberId(), OnPublish);
 }
コード例 #2
0
        public static void UnSubscribe <TArgs1, TArgs2>(this MonoBehaviour monoBehaviour, GameEvent <TArgs1, TArgs2> gameEvent)
        {
            EventsListener eventsListener = CreateEventsListener(monoBehaviour);

            eventsListener.UnSubscribe(gameEvent);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        public static void Subscribe(this MonoBehaviour monoBehaviour, GameEvent gameEvent, Action action)
        {
            EventsListener eventsListener = CreateEventsListener(monoBehaviour);

            eventsListener.Subscribe(gameEvent, action);
        }