我使用
cc.AssetsManager把更新包下载在 /Users/admin/Documents/(local savePath = cc.FileUtils:getInstance():getWritablePath())
在解压包后加载路径
package.path = string.format("%s;%s/?.lua;%s/init.lua",m_package_path , p ,p)
local scene = require(“fruit/src/”…str) 在这里报错了
报错:
load “fruit/src/app/scenes/fruit/fruitScene.lua”, error: syntax error during pre-compilation.
LUA ERROR: error loading module ‘fruit/src/app.scenes.fruit.fruitScene’ from file ‘src/’:
cannot read src/: Is a directory
这里是package.path的输出路径
./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua;src/
./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua;src/;/Users/admin/Documents/HAGame/?.lua
我是想在这个目录下/Users/admin/Documents/HAGame/?.lua 去读取lua 文件