Ejemplo n.º 1
0
        public ThreadStatus L_DoFile(string filename)
        {
#if ASSETBUNDLE
            if ((LuaAPI.luaL_loadpak(this.m_lua, filename) == 0) && (LuaAPI.lua_pcall(this.m_lua, 0, -1, 0) == 0))
            {
                return(ThreadStatus.LUA_OK);
            }
#else
            if ((LuaAPI.luaL_loadfile(this.m_lua, filename) == 0) && (LuaAPI.lua_pcall(this.m_lua, 0, -1, 0) == 0))
            {
                return(ThreadStatus.LUA_OK);
            }
#endif
            //string errorInfo = "luaError: " + LuaInstance.instance.Get().ErrorInfo(1) + Environment.NewLine;
            UnityEngine.Debug.LogError("DoFile Error: " + filename + "\nlua stack: " + LuaInstance.ConstructString(LuaInstance.instance.Get()));
            return(ThreadStatus.LUA_ERRRUN);
        }