Cocos Creator 2.2.0
大厅本身的热更新已经完成,子游戏对比,更新也已经可以用了,但是在进入子游戏的时候报错
根据网上的代码,修改了子游戏的main.js,看下来就是改了注册路径。
if (window.jsb) {
'use strict';
cc.INGAME = (jsb.fileUtils ? jsb.fileUtils.getWritablePath() : '/') + "ALLClass/ClassOne";
if (!cc.chilgame) {
cc.chilgame = window.require(cc.INGAME + '/src/settings.js');
_CCSettings = cc.chilgame;
console.log('======================================= chilgame chilgame '+JSON.stringify(cc.chilgame));
window.require(cc.INGAME + '/src/project.js');
} else {
_CCSettings = cc.chilgame;
}
window.boot();
}
报错:
ScriptEngine::evalString script C:\CocosCreator_2.2.0\resources\cocos2d-x\simulator\win32\ALLClass/ClassOne/src/project.js, failed!
如果将 window.require(cc.INGAME + ‘/src/project.js’); 这句删掉
加载场景的时候,会包如下的错
Failed to load scene: Error: [AssetLibrary] loading JSON or dependencies failed:{“res/import/0d/0dOUwbMUtJfokKDjczROrL.json”:{}}
所以2.2.0版本的子游戏到底是如何更新?