Commit a75ed69d authored by 李维's avatar 李维

修复加载页进度为0的问题

parent f04c8602
......@@ -49022,7 +49022,7 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "bf9e8d51-bf84-493e-a263-1e8bb1856c9b"
......@@ -49143,7 +49143,7 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "478260e5-9b30-430a-8b0a-d6d90c30da7d"
......@@ -49175,7 +49175,7 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "49ace7bb-e59e-4c27-8208-39c200ce2a45"
......@@ -49315,7 +49315,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1348,
"width": 0,
"height": 46
},
"_anchorPoint": {
......@@ -49397,7 +49397,7 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "ae746dc7-f385-47e0-8475-4a5ddae848b3"
......
......@@ -9,6 +9,7 @@ export abstract class middleLayerBase extends cc.Component {
return;
}
this.isShowWaiting = false;
this.setLoadingProgressBar(0);
// 隐藏遮罩层
cc.find(`middleLayer/loadingLayer`).active = false;
}
......@@ -19,6 +20,7 @@ export abstract class middleLayerBase extends cc.Component {
}
this.isShowWaiting = true;
cc.audioEngine.stopAll();
this.setLoadingProgressBar(0);
// 显示遮罩层
cc.find(`middleLayer/loadingLayer`).active = true;
}
......@@ -240,10 +242,9 @@ export abstract class middleLayerBase extends cc.Component {
this.showPreloadWaiting();
cc.audioEngine.stopAll();
this.setLoadingProgressBar(0);
cc.assetManager.loadBundle(bondleUrl, { version: version }, async (err, bundle) => {
bundle.loadScene(sceneName, null, (finish, total, item) => {
this.setLoadingProgressBar(Math.floor(finish / total * 100));
this.setLoadingProgressBar(Math.floor(finish / total * 100));
}, (err, scene) => {
this.courseOpenTimeStamp = Date.now();
cc.director.runScene(scene, null, () => {
......
......@@ -31,10 +31,5 @@ export default class ProgressClass extends cc.Component {
setProgress(progress) {
const scale = progress <= 1 ? progress : 1;
this.bar.width = this.maxWidth * scale;
// console.log(this.bar.width)
}
onEnable() {
this.setProgress(0);
}
}
......@@ -4,7 +4,7 @@
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 480,
......
......@@ -4,7 +4,7 @@
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 1920,
......
......@@ -4,7 +4,7 @@
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 647,
......
......@@ -4,7 +4,7 @@
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 1400,
......
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