static UnityLua() { GlobalLua = new LuaState(); Assembly2Lua.Init(GlobalLua); Json2Lua.Init(GlobalLua); LuaFramework.Init(GlobalLua); }
public static IntPtr GetLuaStateForHotFix() { if (_LuaState == IntPtr.Zero) { if (ThreadSafeValues.IsMainThread) { _LuaState = GlobalLua.L; } else { IntPtr l = _LuaState = new LuaState(); Assembly2Lua.Init(l); Json2Lua.Init(l); LuaFramework.Init(l); // should we init other libs (maybe in other package)? for example: lua-protobuf? // currently these are enough. // and calling a func with hotfix in non-main thread rarely happens. } } return(_LuaState); }
public LuaExporter(string path) { _lua = new LuaFramework(); _lua.ExecuteFile(path); }