예제 #1
0
        private void DispatchEvent(EBEvent e)
        {
            if (!subscribers.ContainsKey(e.type))
            {
                return;
            }

            Dictionary <int, GameObject> typeSubscribers = subscribers[e.type];

            if (e.address == Defines.BROADCAST_ADDRESS)
            {
                foreach (var entry in typeSubscribers)
                {
                    ExecuteEvents.Execute <IEventSubscriber>(entry.Value, null, (handler, data) => handler.OnReceived(e));
                }
            }
            else
            {
                if (!typeSubscribers.ContainsKey(e.address))
                {
                    return;
                }

                ExecuteEvents.Execute <IEventSubscriber>(typeSubscribers[e.address], null, (handler, data) => handler.OnReceived(e));
            }
        }
예제 #2
0
 public void SendEvent(EBEvent e)
 {
     activeQueue.Enqueue(e);
 }