Commit aa42f42a authored by limingzhe's avatar limingzhe

fix: log测试

parent ce782e7e
......@@ -16,6 +16,7 @@ cc.Class({
reviewFlag: false,
async start() {
console.log(' in debug shell start 1');
cc.game.addPersistRootNode(cc.find("cacertNode"));
const middleLayerData = JSON.parse(this.getMiddleLayerData());
......@@ -32,6 +33,8 @@ cc.Class({
this.setMiddleLayerProgress(`正在初始化配置,请耐心等待`);
console.log(' in debug shell start 2');
cc.debug.setDisplayStats(false);
const welcomeNode = cc.find(`Canvas/welcome/${this.middleLayerName}`);
if (welcomeNode) {
......@@ -42,17 +45,29 @@ cc.Class({
canvas.width / welcomeNode.width,
canvas.height / welcomeNode.height
);
console.log(' in debug shell start 3');
}
console.log(' in debug shell start 4');
const uri = `/api/template/v2/${this.middleLayerName}`;
this.setMiddleLayerProgress(`正在检查更新`);
this.callNetworkApiGet(this.baseUrl, uri, {}, (respData) => {
console.log(' in debug shell start 5');
const data = JSON.parse(respData).data;
let sceneName, version, bondleUrl = "";
this.setMiddleLayerProgress(`正在检查配置文件`);
const templateBaseUrl = `${this.DOMAIN}h5template/${data.name}/v${data.last_version}`;
this.callNetworkApiGet(templateBaseUrl, '/config.json', {}, (conf) => {
console.log(' in debug shell start 6');
conf = JSON.parse(conf);
sceneName = conf.android.sceneName;
version = "";
......@@ -70,11 +85,17 @@ cc.Class({
this.setMiddleLayerProgress(`正在加载最新的配置文件`);
cc.assetManager.loadBundle( bondleUrl, { version: version }, async (err, bundle) => {
console.log(' in debug shell start 7');
if (err) {
console.log(err);
return;
}
bundle.loadScene(sceneName, null, (finish, total, item) => {
console.log(' in debug shell start 8');
const p = Math.floor(finish / total * 100);
this.setMiddleLayerProgress(`正在下载资源 ${p}%`);
}, (e, scene) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment