Commit ab5b51a6 authored by liujiangnan's avatar liujiangnan

feat

parent 8b8d1c9b
......@@ -792,6 +792,7 @@ export default class NewClass extends middleLayerBase {
middleLayer.scale = canvas.width / middleLayer.width;
this.loadBundleLock = false; // 加载完成 解锁
this.IS_BUNDLE_LOADING = false;
this.currentBundleInfo = {sceneName: bundleName, version: null, bondleUrl: null};
if (bundleName == 'NJ_YouLeChang') {
cc.find('middleLayer/ram').active = true;
......@@ -807,6 +808,20 @@ export default class NewClass extends middleLayerBase {
return true;
}
// 重写reloadBundle方法
reloadBundle() {
if (this.IS_BUNDLE_LOADING) {
return;
}
this.IS_BUNDLE_LOADING = true;
const { sceneName, version, bondleUrl } = this.currentBundleInfo;
if (bondleUrl) {
this.loadBundle(sceneName, version, bondleUrl);
} else {
this.loadOnlineBundle(sceneName);
}
}
// 重写loadOnlineBundle方法;主要是对一些必要的页面跳转做一些拦截处理
loadOnlineBundle(bundleName, callback = null) {
if (this.IS_BUNDLE_LOADING) {
......
......@@ -206,7 +206,6 @@ export abstract class middleLayerBase extends cc.Component {
return;
}
this.IS_BUNDLE_LOADING = true;
console.log(' in reloadBundle');
const { sceneName, version, bondleUrl } = this.currentBundleInfo;
this.loadBundle(sceneName, version, bondleUrl);
}
......
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