protected virtual void OpenLibs() { //保持库名字与5.1.5库中一致 luaState.BeginPreLoad(); luaState.AddPreLoadLib("pb2", new LuaCSFunction(LuaDLL.luaopen_pb)); luaState.AddPreLoadLib("struct", new LuaCSFunction(LuaDLL.luaopen_struct)); luaState.AddPreLoadLib("lpeg", new LuaCSFunction(LuaDLL.luaopen_lpeg)); luaState.AddPreLoadLib("cjson", new LuaCSFunction(LuaDLL.luaopen_cjson)); luaState.AddPreLoadLib("cjson.safe", new LuaCSFunction(LuaDLL.luaopen_cjson_safe)); #if (UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX) && !LUAC_5_3 luaState.AddPreLoadLib("bit", new LuaCSFunction(LuaDLL.luaopen_bit)); #endif if (LuaConst.openLuaSocket || LuaConst.openLuaDebugger) { OpenLuaSocket(); } luaState.EndPreLoad(); if (LuaConst.openLuaDebugger) { OpenZbsDebugger(); } }