Example #1
0
    public static void StartListening(string eventName, EventGameObject listener)
    {
        EventGameObject delegateDictionary;

        if (instance.eventDictionary.TryGetValue(eventName, out delegateDictionary))
        {
            delegateDictionary += listener;
        }
        else
        {
            delegateDictionary = new EventGameObject(listener);
        }
        instance.eventDictionary[eventName] = delegateDictionary;
    }
Example #2
0
    public static void StopListening(string eventName, EventGameObject listener)
    {
        if (mEventManager == null)
        {
            return;
        }

        EventGameObject delegateDictionary;

        if (instance.eventDictionary.TryGetValue(eventName, out delegateDictionary))
        {
            delegateDictionary = (EventGameObject)Delegate.Remove(delegateDictionary, listener);

            // If a delegate remains, set the new head else remove the EventKey
            if (delegateDictionary != null)
            {
                instance.eventDictionary[eventName] = delegateDictionary;
            }
            else
            {
                instance.eventDictionary.Remove(eventName);
            }
        }
    }
 public void SetStayEvent(EventGameObject hEvent)
 {
     m_hStayEventGameObject = hEvent;
 }
 public void SetEnterEvent(EventGameObject hEvent)
 {
     m_hEnterEventGameObject = hEvent;
 }
 public void SetExitEvent(EventGameObject hEvent)
 {
     m_hExitEventGameObject = hEvent;
 }
Example #6
0
 public void SetHitEventGameObject(EventGameObject hEvent)
 {
     hitEventGameObject = hEvent;
 }
Example #7
0
 public void SetSpawnEvent(EventGameObject hEvent)
 {
     m_hSpawnEvent = hEvent;
 }