public static void TriggerEvent(BooleanEventName eventName, bool argument) { UnityEvent <bool> thisEvent = null; if (Instance.m_eventWithBoolDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.Invoke(argument); } }
public static void StopListening(BooleanEventName eventName, UnityAction <bool> listener) { if (m_eventManager == null) { return; } UnityEvent <bool> thisEvent = null; if (Instance.m_eventWithBoolDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.RemoveListener(listener); } }
public static void StartListening(BooleanEventName eventName, UnityAction <bool> listener) { UnityEvent <bool> thisEvent = null; if (Instance.m_eventWithBoolDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.AddListener(listener); } else { thisEvent = new BoolEvent(); thisEvent.AddListener(listener); Instance.m_eventWithBoolDictionary.Add(eventName, thisEvent); } }