Ejemplo n.º 1
0
        /// <summary>
        /// register a listener to the event manager
        /// </summary>
        public static void StartListening(string eventName, UnityAction <Hashtable> listener)
        {
            HashtableEvent thisEvent = null;

            if (Instance.EventDictionary.TryGetValue(eventName, out thisEvent))
            {
                thisEvent.AddListener(listener);
            }
            else
            {
                thisEvent = new HashtableEvent();
                thisEvent.AddListener(listener);
                Instance.EventDictionary.Add(eventName, thisEvent);
            }
        }
Ejemplo n.º 2
0
    public static void StartListening(string eventName, UnityAction <Hashtable> listener)
    {
        HashtableEvent unityEvent = null;

        if (instance.eventDictionary.TryGetValue(eventName, out unityEvent))
        {
            unityEvent.AddListener(listener);
        }
        else
        {
            unityEvent = new HashtableEvent();
            unityEvent.AddListener(listener);
            instance.eventDictionary.Add(eventName, unityEvent);
        }
    }