这个版本会报这个警告:can not find module for path : undefined
出问题的代码在引擎里面:
cc.require = function (request, path) {
var m = modules[path];
if (!m) {
console.warn('Can not find module for path : ' + path);
return null;
}
这个找不到的JS文件不是组件,只是一个普通的Object,路径放在:assets\Script\SkillScript\里面,代码类似这样:
var ZhanshiPugong = {
};
module.exports = ZhanshiPugong;
然后我的角色就没有动作了
再补充一下,我这个脚本是在函数里面require的,代码像这样:
require(skillConfig.get("cscript"));
这样子调用,第二个参数path是undefined。而正常的在JS头调用,path就有值。

