public static void TriggerEvent(TwoFloatsEventName eventName, float argument1, float argument2) { UnityEvent <float, float> thisEvent = null; if (Instance.m_eventWithTwoFloatsDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.Invoke(argument1, argument2); } }
public static void StopListening(TwoFloatsEventName eventName, UnityAction <float, float> listener) { if (m_eventManager == null) { return; } UnityEvent <float, float> thisEvent = null; if (Instance.m_eventWithTwoFloatsDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.RemoveListener(listener); } }
public static void StartListening(TwoFloatsEventName eventName, UnityAction <float, float> listener) { UnityEvent <float, float> thisEvent = null; if (Instance.m_eventWithTwoFloatsDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.AddListener(listener); } else { thisEvent = new TwoFloatsEvent(); thisEvent.AddListener(listener); Instance.m_eventWithTwoFloatsDictionary.Add(eventName, thisEvent); } }