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; }
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; }
public void SetHitEventGameObject(EventGameObject hEvent) { hitEventGameObject = hEvent; }
public void SetSpawnEvent(EventGameObject hEvent) { m_hSpawnEvent = hEvent; }