public LuaState() { L = LuaLib.luaL_newstate(); if (L == IntPtr.Zero) { UnityEngine.Debug.LogError("Failed to create Lua state!"); return; } _luaStates[L] = this; LuaLib.luaL_openlibs(L); LuaCSFunction panicCallback = new LuaCSFunction(_PanicCallback); LuaLib.lua_atpanic(L, panicCallback); Set("print", (LuaCSFunction)_Print); LuaLib.lua_newtable(L); // |t LuaLib.lua_pushcsfunction(L, _ImportType); // |t|csf LuaLib.lua_setfield(L, -2, "ImportType"); // |t LuaLib.lua_setglobal(L, "wutLua"); // | // _G["wutLua"] = t Bindings = new LuaBindings(this); Bindings.Initialize(); }