static internal int checkDelegate(IntPtr l, int p, out Deleg.GetBundleInfoDelegate 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 = (Deleg.GetBundleInfoDelegate)checkObj(l, p);
                return(op);
            }
            LuaDelegate ld;

            checkType(l, -1, out ld);
            LuaDLL.lua_pop(l, 1);
            if (ld.d != null)
            {
                ua = (Deleg.GetBundleInfoDelegate)ld.d;
                return(op);
            }

            l  = LuaState.get(l).L;
            ua = (string a1, int a2, int a3, ref System.Int32 a4, out System.String a5, out System.Int32 a6) =>
            {
                int error = pushTry(l);

                pushValue(l, a1);
                pushValue(l, a2);
                pushValue(l, a3);
                pushValue(l, a4);
                ld.pcall(4, error);
                bool ret;
                checkType(l, error + 1, out ret);
                checkType(l, error + 2, out a4);
                checkType(l, error + 3, out a5);
                checkType(l, error + 4, out a6);
                LuaDLL.lua_settop(l, error - 1);
                return(ret);
            };
            ld.d = ua;
            return(op);
        }
        static internal int checkDelegate(IntPtr l, int p, out Deleg.GetBundleInfoDelegate ua)
        {
            int op = extractFunction(l, p);

            if (LuaDLL.lua_isnil(l, -1))
            {
                ua = null;
                return(op);
            }
            int r = LuaDLL.luaS_checkcallback(l, -1);

            if (r < 0)
            {
                LuaDLL.luaL_error(l, "expect function");
            }
            if (getCacheDelegate <Deleg.GetBundleInfoDelegate>(r, out ua))
            {
                return(op);
            }
            LuaDLL.lua_pop(l, 1);
            ua = (string a1, out System.String a2, out System.Int32 a3) =>
            {
                int error = pushTry(l);
                LuaDLL.lua_getref(l, r);

                pushValue(l, a1);
                if (LuaDLL.lua_pcall(l, 1, -1, error) != 0)
                {
                    LuaDLL.lua_pop(l, 1);
                }
                bool ret;
                checkType(l, error + 1, out ret);
                checkType(l, error + 2, out a2);
                checkType(l, error + 3, out a3);
                LuaDLL.lua_pop(l, 1);
                return(ret);
            };
            cacheDelegate(r, ua);
            return(op);
        }
Exemplo n.º 3
0
        }                                 // 0x0084A330-0x0084A3A0

        // Methods
        internal static int checkDelegate(IntPtr l, int p, out Deleg.GetBundleInfoDelegate ua)
        {
            ua = default;
            return(default);