unity打包运行之后找不到对应的lua程序,应当将所有的lua程序当做资源一样压缩。unity运行之后再进行读取。
LuaState lua = new LuaState();
lua.Start();
// Debug.Log(Resources.Load(“Lua/teacherdevice/Cube”));
TextAsset ta = Resources.Load(“Lua/teacherdevice/TeacherDevice.lua”) as TextAsset;//Resources加载lua文件
TextAsset globo = Resources.Load(“Lua/Globo.lua”) as TextAsset;//Resources加载lua文件
// lua.DoString(globo.text);
lua.DoString(ta.text);