private LuaEnv luaEnv;
private void Awake()
{
luaEnv = new LuaEnv();
luaEnv.AddLoader(MyLoader);
luaEnv.DoString("require'fish'");
}
private byte[] MyLoader(ref string filePath)
{
string absPath = @Application.dataPath+"/xx/"+filePath+".lua.txt";
return System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(absPath));
}
private void OnDestroy()
{
luaEnv.Dispose();
}