Commit 42679a23 authored by limingzhe's avatar limingzhe

fix: debug

parent 06843e90
{"ver":"1.1.2","uuid":"c35bb2f6-f24a-4850-ae44-643f2fdc7541","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}} {
\ No newline at end of file "ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
...@@ -490,6 +490,7 @@ export default class middleLayer extends cc.Component { ...@@ -490,6 +490,7 @@ export default class middleLayer extends cc.Component {
}); });
} }
curBundle;
async loadBundle(sceneName, version, bondleUrl, callback = null) { async loadBundle(sceneName, version, bondleUrl, callback = null) {
this.assetList = []; this.assetList = [];
...@@ -498,13 +499,16 @@ export default class middleLayer extends cc.Component { ...@@ -498,13 +499,16 @@ export default class middleLayer extends cc.Component {
this.nodeList = []; this.nodeList = [];
console.log('汪汪汪: getDragonDisplayAssetList'); console.log('汪汪汪: getDragonDisplayAssetList');
this.getDragonDisplayAssetList(cc.find('Canvas')); this.getDragonDisplayAssetList(cc.find('Canvas'));
this.getSpriteAssetList(cc.find('Canvas')); // this.getSpriteAssetList(cc.find('Canvas'));
cc.audioEngine.stopAll(); cc.audioEngine.stopAll();
cc.assetManager.loadBundle( cc.assetManager.loadBundle(
bondleUrl, bondleUrl,
{ version: version }, { version: version },
async (err, bundle) => { async (err, bundle) => {
this.curBundle = bundle;
console.log('汪汪汪: loadBundle', bundle);
bundle.loadScene( bundle.loadScene(
sceneName, sceneName,
null, null,
...@@ -682,7 +686,18 @@ export default class middleLayer extends cc.Component { ...@@ -682,7 +686,18 @@ export default class middleLayer extends cc.Component {
this.hideCloseGameBtn(); this.hideCloseGameBtn();
cc.audioEngine.stopAll(); cc.audioEngine.stopAll();
if (this.curBundle) {
this.curBundle.releaseUnusedAssets();
const oldBundle = cc.assetManager.getBundle(this.curBundle.name);
oldBundle?.releaseAll();
this.curBundle = null;
}
// cc.director.getScene().destroy();
if ( cc.assetManager.releaseUnusedAssets) {
console.log('汪汪汪: releaseUnusedAssets');
cc.assetManager.releaseUnusedAssets();
}
// 强制触发一次垃圾回收(主要是 js 对象) // 强制触发一次垃圾回收(主要是 js 对象)
cc.sys.garbageCollect(); cc.sys.garbageCollect();
......
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