예제 #1
0
    public static void TriggerEvent(FloatEventName eventName, float argument)
    {
        UnityEvent <float> thisEvent = null;

        if (Instance.m_eventWithFloatDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.Invoke(argument);
        }
    }
예제 #2
0
    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);
        }
    }
예제 #3
0
    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);
        }
    }