static int set_onPress(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); PressEventListener obj = (PressEventListener)o; PressEventListener.BoolDelegate arg0 = null; LuaTypes funcType2 = LuaDLL.lua_type(L, 2); if (funcType2 != LuaTypes.LUA_TFUNCTION) { arg0 = (PressEventListener.BoolDelegate)ToLua.CheckObject(L, 2, typeof(PressEventListener.BoolDelegate)); } else { LuaFunction func = ToLua.ToLuaFunction(L, 2); arg0 = DelegateFactory.CreateDelegate(typeof(PressEventListener.BoolDelegate), func) as PressEventListener.BoolDelegate; } obj.onPress = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onPress on a nil value" : e.Message)); } }
static int Get(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckUnityObject(L, 1, typeof(UnityEngine.GameObject)); PressEventListener o = PressEventListener.Get(arg0); ToLua.Push(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int OnPointerUp(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); PressEventListener obj = (PressEventListener)ToLua.CheckObject(L, 1, typeof(PressEventListener)); UnityEngine.EventSystems.PointerEventData arg0 = (UnityEngine.EventSystems.PointerEventData)ToLua.CheckObject(L, 2, typeof(UnityEngine.EventSystems.PointerEventData)); obj.OnPointerUp(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public static PressEventListener Get(GameObject go) { PressEventListener listener = go.GetComponent <PressEventListener>(); if (listener == null) { listener = go.AddComponent <PressEventListener>(); } var g = go.GetComponent <Graphic>(); if (g != null) { g.raycastTarget = true; } return(listener); }
static int get_onPress(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); PressEventListener obj = (PressEventListener)o; PressEventListener.BoolDelegate ret = obj.onPress; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onPress on a nil value" : e.Message)); } }