public static void StopListening(string eventName, UnityAction <Hashtable> listener) { if (eventManager == null) { return; } HashtableEvent unityEvent = null; if (instance.eventDictionary.TryGetValue(eventName, out unityEvent)) { unityEvent.RemoveListener(listener); } }
/// <summary> /// unregister a listener from the event manager /// </summary> public static void StopListening(string eventName, UnityAction <Hashtable> listener) { if (Instance == null) { return; } HashtableEvent thisEvent = null; if (Instance.EventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.RemoveListener(listener); } }
public void StopListening(string eventName, UnityAction <Hashtable> listener) { HashtableEvent thisEvent = null; if (eventDictionary.TryGetValue(eventName, out thisEvent)) { if (listener == null) { thisEvent.RemoveAllListeners(); } else { thisEvent.RemoveListener(listener); } } }