因为这个问题在16年有问过了,最近自己测试的结果是不行。
以下是我的方式。
main.js 中
// 预先将热更新后的场景加入
var obj = {
“url” : “db://assets/GameA/GameA.fire”,
“uuid” : “51ecb7d5-b04a-446c-82f7-3a65398c93cc”
};
_InitObj.scenes.push(obj);
option.scenes = _InitObj.scenes;
cc.game.run(option, onStart);
hotupdate.js 中
// 当下载远端游戏资源包后,在require此游戏所需要的脚本。
path = ((jsb.fileUtils ? jsb.fileUtils.getWritablePath() : ‘/hotupdateFunc/’) + this.gameName + “/src/project_GameA.js”);
require(path);
之后loadScene出现的错误是:
/Users/rebornchen/Documents/CreatorProjects/HotUpdate_FUNC/build_v1_0/jsb-binary/src/jsb_polyfill.js line:9 msg:TypeError: i[1].split is not a function
请问
(1)有人可以提供查看jsb_polyfill.js的方法吗?
(2)能够不启动游戏进入新加入的场景吗?
如果一定要重启游戏那么要如何保存宣告的变数呢? (例如:websocket连线)