public LuaSvr(string main) { luaState = new LuaState(); LuaObject.init(luaState.L); bind("BindUnity"); bind("BindUnityUI"); bind("BindCustom"); bind("BindExtend"); // if you want to extend slua, can implemented BindExtend function like BindCustom etc. 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); 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); } }
public LuaSvr(string main) { luaState = new LuaState(); 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); try { LuaDLL.luaS_openextlibs(luaState.L); } catch (Exception) { // do nothing } 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); } }
protected void doinit(IntPtr L, LuaSvrFlag flag) { #if !SLUA_STANDALONE LuaTimer.reg(L); if (!SLuaSetting.IsEditor || SLuaSetting.IsPlaying) { LuaCoroutine.reg(L, lgo); } #endif Helper.reg(L); if ((flag & LuaSvrFlag.LSF_EXTLIB) != 0) { LuaDLL.luaS_openextlibs(L); } if ((flag & LuaSvrFlag.LSF_3RDDLL) != 0) { Lua3rdDLL.open(L); } #if !SLUA_STANDALONE if (!SLuaSetting.IsEditor || SLuaSetting.IsPlaying) { lgo.state = luaState; lgo.onUpdate = this.tick; lgo.init(); } #endif inited = true; }
void doinit(IntPtr L, LuaSvrFlag flag, bool useTick) { if (!editor) { #if !SLUA_STANDALONE LuaTimer.reg(L); LuaCoroutine.reg(L, lgo); #endif Helper.reg(L); LuaValueType.reg(L); } if ((flag & LuaSvrFlag.LSF_EXTLIB) != 0) { LuaDLL.luaS_openextlibs(L); } if ((flag & LuaSvrFlag.LSF_3RDDLL) != 0) { Lua3rdDLL.open(L); } if (!editor) { #if !SLUA_STANDALONE lgo.state = luaState; if (useTick) { lgo.onUpdate = this.tick; } lgo.init(); #endif } inited = true; }
void doinit(IntPtr L, LuaSvrFlag flag) { LuaTimer.reg(L); LuaCoroutine.reg(L, lgo); Helper.reg(L); LuaValueType.reg(L); if ((flag & LuaSvrFlag.LSF_DEBUG) != 0) { SLuaDebug.reg(L); } if ((flag & LuaSvrFlag.LSF_EXTLIB) != 0) { LuaDLL.luaS_openextlibs(L); } if ((flag & LuaSvrFlag.LSF_3RDDLL) != 0) { Lua3rdDLL.open(L); } lgo.state = luaState; lgo.onUpdate = this.tick; lgo.init(); inited = true; }
public void openSluaLib() { #if !SLUA_STANDALONE LuaTimer.reg(L); LuaCoroutine.reg(L, LuaSvr.gameObject); #endif Lua_SLua_ByteArray.reg(L); Helper.reg(L); }
static int init(IntPtr L) { LuaObject.init(L); bindAll(L); LuaTimer.reg(L); LuaCoroutine.reg(L, lgo); Helper.reg(L); LuaValueType.reg(L); SLuaDebug.reg(L); LuaDLL.luaS_openextlibs(L); return(0); }
void doinit(IntPtr L) { LuaTimer.reg(L); LuaCoroutine.reg(L, lgo); Helper.reg(L); LuaValueType.reg(L); SLuaDebug.reg(L); LuaDLL.luaS_openextlibs(L); Lua3rdDLL.open(L); lgo.state = luaState; lgo.onUpdate = this.tick; lgo.init(); inited = true; }
public void openSluaLib() { LuaArray.init(L); LuaVarObject.init(L); LuaDLL.lua_newtable(L); LuaDLL.lua_setglobal(L, DelgateTable); #if !SLUA_STANDALONE LuaTimer.reg(L); LuaCoroutine.reg(L, lgo); #endif Lua_SLua_ByteArray.reg(L); Helper.reg(L); openedSluaLib = true; }
protected void doinit(IntPtr L, LuaSvrFlag flag) { #if !SLUA_STANDALONE LuaTimer.reg(L); #if UNITY_EDITOR if (UnityEditor.EditorApplication.isPlaying) #endif LuaCoroutine.reg(L, lgo); #endif Lua_SLua_ByteArray.reg(L); Helper.reg(L); LuaValueType.reg(L); if ((flag & LuaSvrFlag.LSF_EXTLIB) != 0) { LuaDLL.luaS_openextlibs(L); LuaSocketMini.reg(L); } if ((flag & LuaSvrFlag.LSF_3RDDLL) != 0) { Lua3rdDLL.open(L); } #if !SLUA_STANDALONE #if UNITY_EDITOR if (UnityEditor.EditorApplication.isPlaying) { #endif lgo.state = luaState; lgo.onUpdate = this.tick; lgo.init(); #if UNITY_EDITOR } #endif #endif inited = true; }