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