public static void DispatchLongPressEvent(string UIName, string ComponentName, string parm, InputUIEventType type) { //只有允许输入时才派发事件 if (IsActive) { InputUILongPressEvent e = GetUIEvent <InputUILongPressEvent>(UIName, ComponentName, parm); e.m_type = type; //e.m_LongPressType = type; e.EventKey = InputUILongPressEvent.GetEventKey(UIName, ComponentName, parm); InputMessageManager.Dispatch("InputUILongPressEvent", e); } }
public static InputEventRegisterInfo <InputUILongPressEvent> GetLongPressListener(LongPressAcceptor acceptor, string UIName, string ComponentName, string parm, InputEventHandle <InputUILongPressEvent> callback) { InputlongPressRegisterInfo info = HeapObjectPool <InputlongPressRegisterInfo> .GetObject(); info.eventKey = InputUILongPressEvent.GetEventKey(UIName, ComponentName, parm); info.callBack = callback; info.m_acceptor = acceptor; info.m_OnLongPress = (type) => { DispatchLongPressEvent(UIName, ComponentName, parm, type); }; return(info); }