示例#1
0
文件: LuaSvr.cs 项目: moto2002/Luna
        public LuaSvr(string main)
        {
            luaState = new LuaState();

            GameObject go = new GameObject("LuaSvrProxy");

            lgo = go.AddComponent <LuaSvrGameObject>();
            GameObject.DontDestroyOnLoad(go);
            lgo.state    = luaState;
            lgo.onUpdate = this.tick;

            LuaState.pcall(luaState.L, init);

            start(main);

            if (LuaDLL.lua_gettop(luaState.L) != errorReported)
            {
                Debug.LogError("Some function not remove temp value from lua stack. You should fix it.");
                errorReported = LuaDLL.lua_gettop(luaState.L);
            }
        }