Esempio n. 1
0
 static UnityLua()
 {
     GlobalLua = new LuaState();
     Assembly2Lua.Init(GlobalLua);
     Json2Lua.Init(GlobalLua);
     LuaFramework.Init(GlobalLua);
 }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 public LuaExporter(string path)
 {
     _lua = new LuaFramework();
     _lua.ExecuteFile(path);
 }