Example #1
0
    public static void TriggerEvent(BooleanEventName eventName, bool argument)
    {
        UnityEvent <bool> thisEvent = null;

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