static int GetLongPressComp(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UIBase obj = (UIBase)ToLua.CheckObject(L, 1, typeof(UIBase)); string arg0 = ToLua.CheckString(L, 2); LongPressAcceptor o = obj.GetLongPressComp(arg0); ToLua.Push(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public LongPressAcceptor GetLongPressComp(string name) { if (m_longPressList.ContainsKey(name)) { return(m_longPressList[name]); } LongPressAcceptor tmp = GetGameObject(name).GetComponent <LongPressAcceptor>(); if (tmp == null) { throw new Exception(m_EventNames + " GetLongPressComp ->" + name + "<- is Null !"); } m_longPressList.Add(name, tmp); return(tmp); }
public static InputEventRegisterInfo <InputUILongPressEvent> AddLongPressListener(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); }; info.AddListener(); acceptor.OnLongPress += info.m_OnLongPress; return(info); }