static int set_onKey(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIEventListener obj = (UIEventListener)o; UIEventListener.KeyCodeDelegate arg0 = null; LuaTypes funcType2 = LuaDLL.lua_type(L, 2); if (funcType2 != LuaTypes.LUA_TFUNCTION) { arg0 = (UIEventListener.KeyCodeDelegate)ToLua.CheckObject(L, 2, typeof(UIEventListener.KeyCodeDelegate)); } else { LuaFunction func = ToLua.ToLuaFunction(L, 2); arg0 = DelegateFactory.CreateDelegate(typeof(UIEventListener.KeyCodeDelegate), func) as UIEventListener.KeyCodeDelegate; } obj.onKey = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onKey on a nil value" : e.Message)); } }
internal static int checkDelegate(IntPtr l, int p, out UIEventListener.KeyCodeDelegate ua) { int result = LuaObject.extractFunction(l, p); if (LuaDLL.pua_isnil(l, p)) { ua = null; return(result); } if (LuaDLL.pua_isuserdata(l, p) == 1) { ua = (UIEventListener.KeyCodeDelegate)LuaObject.checkObj(l, p); return(result); } LuaDelegate ld; LuaObject.checkType(l, -1, out ld); LuaDLL.pua_pop(l, 1); if (ld.d != null) { ua = (UIEventListener.KeyCodeDelegate)ld.d; return(result); } l = LuaState.get(l).L; ua = delegate(GameObject a1, KeyCode a2) { int num = LuaObject.pushTry(l); LuaObject.pushValue(l, a1); LuaObject.pushValue(l, a2); ld.pcall(2, num); LuaDLL.pua_settop(l, num - 1); }; ld.d = ua; return(result); }
public static Delegate UIEventListener_KeyCodeDelegate(LuaFunction func) { if (func == null) { UIEventListener.KeyCodeDelegate fn = delegate { }; return(fn); } UIEventListener.KeyCodeDelegate d = (new UIEventListener_KeyCodeDelegate_Event(func)).Call; return(d); }
public static Delegate UIEventListener_KeyCodeDelegate(LuaFunction func) { UIEventListener.KeyCodeDelegate d = (param0, param1) => { int top = func.BeginPCall(); IntPtr L = func.GetLuaState(); LuaScriptMgr.Push(L, param0); LuaScriptMgr.Push(L, param1); func.PCall(top, 2); func.EndPCall(top); }; return(d); }
static int set_onKey(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIEventListener obj = (UIEventListener)o; UIEventListener.KeyCodeDelegate arg0 = (UIEventListener.KeyCodeDelegate)ToLua.CheckDelegate <UIEventListener.KeyCodeDelegate>(L, 2); obj.onKey = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index onKey on a nil value")); } }
static int get_onKey(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIEventListener obj = (UIEventListener)o; UIEventListener.KeyCodeDelegate ret = obj.onKey; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index onKey on a nil value")); } }
public void Clear() { this.onSubmit = null; this.onClick = null; this.onDoubleClick = null; this.onHover = null; this.onPress = null; this.onSelect = null; this.onScroll = null; this.onDragStart = null; this.onDrag = null; this.onDragOver = null; this.onDragOut = null; this.onDragEnd = null; this.onDrop = null; this.onKey = null; this.onTooltip = null; }
private static int get_onKey(IntPtr L) { object obj = null; int result; try { obj = ToLua.ToObject(L, 1); UIEventListener uIEventListener = (UIEventListener)obj; UIEventListener.KeyCodeDelegate onKey = uIEventListener.onKey; ToLua.Push(L, onKey); result = 1; } catch (Exception ex) { result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index onKey on a nil value"); } return(result); }
static internal int checkDelegate(IntPtr l, int p, out UIEventListener.KeyCodeDelegate ua) { int op = extractFunction(l, p); if (LuaDLL.lua_isnil(l, p)) { ua = null; return(op); } else if (LuaDLL.lua_isuserdata(l, p) == 1) { ua = (UIEventListener.KeyCodeDelegate)checkObj(l, p); return(op); } LuaDelegate ld; checkType(l, -1, out ld); if (ld.d != null) { ua = (UIEventListener.KeyCodeDelegate)ld.d; return(op); } LuaDLL.lua_pop(l, 1); l = LuaState.get(l).L; ua = (UnityEngine.GameObject a1, UnityEngine.KeyCode a2) => { int error = pushTry(l); pushValue(l, a1); pushValue(l, a2); ld.pcall(2, error); LuaDLL.lua_settop(l, error - 1); }; ld.d = ua; return(op); }