// Use this for initialization void Awake() { _luaHotfix = this; _luaEnv = new LuaEnv(); _luaEnv.AddLoader((ref string filename) => { //lua customer path filename = Util.PersistentDataPath + "lua/game/" + filename + ".lua"; return(File.ReadAllBytes(filename)); /*** * string script= File.ReadAllText(filename); * return System.Text.Encoding.UTF8.GetBytes(script); ***/ }); }
void OnDestroy() { _luaEnv = null; _luaHotfix = null; }