public static void TriggerEvent(string eventName, Hashtable hashtable) { HashtableEvent unityEvent = null; if (instance.eventDictionary.TryGetValue(eventName, out unityEvent)) { unityEvent.Invoke(hashtable); } }
/// <summary> /// call to trigger the event /// </summary> public static void TriggerEvent(string eventName, Hashtable eventParams = default(Hashtable)) { HashtableEvent thisEvent = null; if (Instance.EventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.Invoke(eventParams); } }
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); } }
/// <summary> /// register a listener to the event manager /// </summary> public static void StartListening(string eventName, UnityAction <Hashtable> listener) { HashtableEvent thisEvent = null; if (Instance.EventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.AddListener(listener); } else { thisEvent = new HashtableEvent(); thisEvent.AddListener(listener); Instance.EventDictionary.Add(eventName, thisEvent); } }
public static void StartListening(string eventName, UnityAction <Hashtable> listener) { HashtableEvent unityEvent = null; if (instance.eventDictionary.TryGetValue(eventName, out unityEvent)) { unityEvent.AddListener(listener); } else { unityEvent = new HashtableEvent(); unityEvent.AddListener(listener); instance.eventDictionary.Add(eventName, unityEvent); } }
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); } } }