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)); } }
public void SendEvent(EBEvent e) { activeQueue.Enqueue(e); }