예제 #1
0
    public static void TriggerEvent(string eventName, Route param)
    {
        UnityEventRoute thisEvent = null;

        if (Instance != null && Instance.eventDictionaryRoute.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.Invoke(param);
        }
    }
예제 #2
0
    public static void StopListeningClass(string eventName, UnityAction <Route> listener)
    {
        if (Instance == null)
        {
            return;
        }
        UnityEventRoute thisEvent = null;

        if (Instance.eventDictionaryRoute.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.RemoveListener(listener);
        }
    }
예제 #3
0
    public static void StartListeningClass(string eventName, UnityAction <Route> listener)
    {
        UnityEventRoute thisEvent = null;

        if (Instance.eventDictionaryRoute.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.AddListener(listener);
        }
        else
        {
            thisEvent = new UnityEventRoute();
            thisEvent.AddListener(listener);
            Instance.eventDictionaryRoute.Add(eventName, thisEvent);
        }
    }