コード例 #1
0
ファイル: Lua.cs プロジェクト: yunsite/ME_SLua
    public Lua()
    {
        LuaState.loaderDelegate += luaLoader;
        luaState = new LuaState();

        //  LuaDLL.lua_pushstdcallcfunction(luaState.L, import);
        //LuaDLL.lua_setglobal(luaState.L, "using");

        LuaObject.init(luaState.L);
        bindAll(luaState.L);

        GameObject go = new GameObject("LuaSvrProxy");

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

        LuaTimer.reg(luaState.L);
        LuaCoroutine.reg(luaState.L, lgo);
        Helper.reg(luaState.L);
        LuaValueType.reg(luaState.L);
        LuaDLL.luaS_openextlibs(luaState.L);

        /*
         * 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);
         * }
         * */
    }
コード例 #2
0
ファイル: LuaBridge.cs プロジェクト: swordlegend/army_ru
        public LuaBridge()
        {
            GameObject go = new GameObject("LuaSvrProxy");

            lgo = go.AddComponent <LuaSvrGameObject>();
            GameObject.DontDestroyOnLoad(go);
        }