static internal int checkDelegate(IntPtr l, int p, out FairyGUI.UILoadCallback 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 = (FairyGUI.UILoadCallback)checkObj(l, p); return(op); } LuaDelegate ld; checkType(l, -1, out ld); if (ld.d != null) { ua = (FairyGUI.UILoadCallback)ld.d; return(op); } LuaDLL.lua_pop(l, 1); l = LuaState.get(l).L; ua = () => { int error = pushTry(l); ld.pcall(0, error); LuaDLL.lua_settop(l, error - 1); }; ld.d = ua; return(op); }
static int _m_Load(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); FairyGUI.IUISource gen_to_be_invoked = (FairyGUI.IUISource)translator.FastGetCSObj(L, 1); { FairyGUI.UILoadCallback _callback = translator.GetDelegate <FairyGUI.UILoadCallback>(L, 2); gen_to_be_invoked.Load(_callback); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }