Commit aa42f42a authored by limingzhe's avatar limingzhe

fix: log测试

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