public static Delegate UICamera_GetAnyKeyFunc(LuaFunction func) { UICamera.GetAnyKeyFunc d = () => { object[] objs = func.Call(); return((bool)objs[0]); }; return(d); }
public static Delegate UICamera_GetAnyKeyFunc(LuaFunction func) { if (func == null) { UICamera.GetAnyKeyFunc fn = delegate { return(false); }; return(fn); } UICamera.GetAnyKeyFunc d = (new UICamera_GetAnyKeyFunc_Event(func)).Call; return(d); }
static internal int checkDelegate(IntPtr l, int p, out UICamera.GetAnyKeyFunc 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 = (UICamera.GetAnyKeyFunc)checkObj(l, p); return(op); } LuaDelegate ld; checkType(l, -1, out ld); if (ld.d != null) { ua = (UICamera.GetAnyKeyFunc)ld.d; return(op); } LuaDLL.lua_pop(l, 1); l = LuaState.get(l).L; ua = () => { int error = pushTry(l); ld.pcall(0, error); bool ret; checkType(l, error + 1, out ret); LuaDLL.lua_settop(l, error - 1); return(ret); }; ld.d = ua; return(op); }