/// <summary> /// Removes all listeners with the same event listener type /// </summary> /// <param name="listenerType"></param> public void RemoveEventListeners(CCEventListenerType listenerType) { switch (listenerType) { case CCEventListenerType.TOUCH_ONE_BY_ONE: RemoveEventListeners(CCEventListenerTouchOneByOne.LISTENER_ID); break; case CCEventListenerType.TOUCH_ALL_AT_ONCE: RemoveEventListeners(CCEventListenerTouchAllAtOnce.LISTENER_ID); break; case CCEventListenerType.MOUSE: RemoveEventListeners(CCEventListenerMouse.LISTENER_ID); break; case CCEventListenerType.ACCELEROMETER: RemoveEventListeners(CCEventListenerAccelerometer.LISTENER_ID); break; case CCEventListenerType.KEYBOARD: RemoveEventListeners(CCEventListenerKeyboard.LISTENER_ID); break; case CCEventListenerType.GAMEPAD: RemoveEventListeners(CCEventListenerGamePad.LISTENER_ID); break; default: Debug.Assert(false, "Invalid listener type!"); break; } }
/// <summary> /// Initializes event with type and callback function /// </summary> /// <param name="type"></param> /// <param name="listenerID"></param> /// <param name="callback"></param> protected CCEventListener(CCEventListenerType type, string listenerID, Action <CCEvent> callback) : this(type, listenerID) { OnEvent = callback; }
protected CCEventListener(CCEventListenerType type, string listenerID) : this() { Type = type; ListenerID = listenerID; }
/// <summary> /// Removes all listeners with the same event listener type /// </summary> /// <param name="listenerType"></param> public void RemoveEventListeners(CCEventListenerType listenerType) { switch (listenerType) { case CCEventListenerType.TOUCH_ONE_BY_ONE: RemoveEventListeners (CCEventListenerTouchOneByOne.LISTENER_ID); break; case CCEventListenerType.TOUCH_ALL_AT_ONCE: RemoveEventListeners (CCEventListenerTouchAllAtOnce.LISTENER_ID); break; case CCEventListenerType.MOUSE: RemoveEventListeners (CCEventListenerMouse.LISTENER_ID); break; case CCEventListenerType.ACCELEROMETER: RemoveEventListeners (CCEventListenerAccelerometer.LISTENER_ID); break; case CCEventListenerType.KEYBOARD: RemoveEventListeners (CCEventListenerKeyboard.LISTENER_ID); break; case CCEventListenerType.GAMEPAD: RemoveEventListeners (CCEventListenerGamePad.LISTENER_ID); break; default: Debug.Assert (false, "Invalid listener type!"); break; } }
protected CCEventListener(CCEventListenerType type, string listenerID) : this() { Type = type; ListenerID = listenerID; }
/// <summary> /// Initializes event with type and callback function /// </summary> /// <param name="type"></param> /// <param name="listenerID"></param> /// <param name="callback"></param> protected CCEventListener(CCEventListenerType type, string listenerID, Action<CCEvent> callback) : this(type, listenerID) { OnEvent = callback; }