Commit 888f5f10 authored by liujiangnan's avatar liujiangnan

加catch

parent 635aae5e
...@@ -121,35 +121,39 @@ export default class NewClass extends middleLayerBase { ...@@ -121,35 +121,39 @@ export default class NewClass extends middleLayerBase {
} }
return; return;
} }
cc.assetManager.loadBundle(scene.bondleUrl, { version: scene.version }, (err, bundle) => { try {
console.log(`${scene.bondleUrl}---场景开始loadBundle----`); cc.assetManager.loadBundle(scene.bondleUrl, { version: scene.version }, (err, bundle) => {
if (!bundle) { console.log(`${scene.bondleUrl}---场景开始loadBundle----`);
_this.loadedCount++; if (!bundle) {
_this.updateProcessBar(); _this.loadedCount++;
i++; _this.updateProcessBar();
if (i < scenes.length) { i++;
setTimeout(() => { if (i < scenes.length) {
load(); setTimeout(() => {
}, 1); load();
} else { }, 1);
resolve(); } else {
} resolve();
return; }
} return;
bundle.preloadScene(scene.sceneName, () => { }, () => {
console.log(`${scene.sceneName}场景预加载结束`);
_this.loadedCount++;
_this.updateProcessBar();
i++;
if (i < scenes.length) {
setTimeout(() => {
load();
}, 1);
} else {
resolve();
} }
try {
bundle.preloadScene(scene.sceneName, () => { }, () => {
console.log(`${scene.sceneName}场景预加载结束`);
_this.loadedCount++;
_this.updateProcessBar();
i++;
if (i < scenes.length) {
setTimeout(() => {
load();
}, 1);
} else {
resolve();
}
});
} catch (error) {}
}); });
}); } catch(e) {}
} }
if (scenes && scenes.length > 0) { if (scenes && scenes.length > 0) {
......
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