Esempio n. 1
0
        //如果不出错,则保留返回值在堆栈上,返回 true
        //如果出错,压入调用堆栈信息,返回 false
        public bool PCall(int nArgs, int nResults)
        {
            /*
             * int oldTop = LuaDLL.lua_gettop(L) - nArgs - 1;
             * LuaDLL.lua_rawgeti(L, LuaIndexes.LUA_REGISTRYINDEX, errorFuncRef);
             * LuaDLL.lua_insert(L, oldTop + 1);
             * if (LuaDLL.lua_pcall(L, nArgs, nResults, oldTop + 1) == 0)
             * {
             *  LuaDLL.lua_remove(L, oldTop + 1);	//pop errorFunc
             *  return true;
             * }
             * else
             * {
             *  LuaDLL.lua_remove(L, oldTop + 1);	//pop errorFunc
             *  return false;
             * }
             */

            return(LuaDLL.HOBA_Unity_Lua_PCall(L, nArgs, nResults, LuaIndexes.LUA_REGISTRYINDEX, errorFuncRef));
        }