public void RegisterEventListener(BaseEventListener listener) { lock (m_syncLock) { if (m_listeners.Add(listener)) { foreach (var mergedEventSource in m_mergedEventSources) { listener.RegisterEventSource(mergedEventSource); } } } }
public void UnregisterEventListener(BaseEventListener listener, bool disableEvents = false) { lock (m_syncLock) { if (m_listeners.Remove(listener)) { if (disableEvents) { foreach (var mergedEventSource in m_mergedEventSources) { listener.DisableEvents(mergedEventSource); } } } } }