void Start () {
LuaEnv env = new LuaEnv();
env.AddLoader(MyLoader);
env.DoString("require 'fish'");
}
byte[] MyLoader(ref string pathfile)
{
string absPath = @"E:\ProjA\LUALearn\" + pathfile + ".lua.txt";
return System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(absPath));
}
坑:
lua编码使用UTF8编码格式