Commit b9c7f3a1 authored by limingzhe's avatar limingzhe

fix: debug

parent 6ae0dde6
...@@ -196,7 +196,8 @@ export abstract class middleLayerBase extends cc.Component { ...@@ -196,7 +196,8 @@ export abstract class middleLayerBase extends cc.Component {
console.log('喵喵喵3: ' + this.assetList.length); console.log('喵喵喵3: ' + this.assetList.length);
console.log('喵喵喵4: ' + this.textureList.length); console.log('喵喵喵4: ' + this.textureList.length);
// this.clearDragonDisplayAssetList2(); this.clearDragonDisplayAssetList3();
await asyncDelay(5);
this.loadBundleLock = true; // 加锁 this.loadBundleLock = true; // 加锁
this.currentBundleInfo = { sceneName, version, bondleUrl }; this.currentBundleInfo = { sceneName, version, bondleUrl };
...@@ -474,41 +475,78 @@ export abstract class middleLayerBase extends cc.Component { ...@@ -474,41 +475,78 @@ export abstract class middleLayerBase extends cc.Component {
await asyncDelay(0.001); await asyncDelay(0.001);
for (let i=0; i<this.atlasList.length; i++) {
const atlas = this.atlasList[i];
const asset = this.assetList[i];
const texture = this.textureList[i];
const node = this.nodeList[i];
atlas.decRef();
cc.assetManager.releaseAsset(atlas);
atlas.destroy();
asset.decRef();
cc.assetManager.releaseAsset(asset);
asset.destroy();
node.active = false;
node.removeFromParent();
texture.decRef();
await asyncDelay(0.001);
}
// [ ...this.atlasList , ...this.assetList].forEach(asset => {
// asset.decRef();
// cc.assetManager.releaseAsset(asset);
// asset.destroy();
// });
// this.nodeList.forEach(node => {
// node.active = false;
// node.removeFromParent();
// });
// this.textureList.forEach(texture => {
// texture.decRef();
// });
this.textureList.forEach(texture => { // this.textureList.forEach(texture => {
// console.log('texture_uuid: ', texture._uuid); // // console.log('texture_uuid: ', texture._uuid);
// console.log('texture: ', texture); // // console.log('texture: ', texture);
// while (texture?.refCount > 0) { // // while (texture?.refCount > 0) {
// texture.decRef(); // // texture.decRef();
// } // // }
cc.assetManager.releaseAsset(texture); // cc.assetManager.releaseAsset(texture);
texture.destroy(); // texture.destroy();
}); // });
[ ...this.atlasList, ...this.assetList ].forEach(asset => { // [ ...this.atlasList, ...this.assetList ].forEach(asset => {
console.log('asset_uuid: ', asset._uuid); // console.log('asset_uuid: ', asset._uuid);
console.log('asset: ', asset); // console.log('asset: ', asset);
// asset.decRef(); // // asset.decRef();
// while (asset?.refCount > 0) { // // while (asset?.refCount > 0) {
// asset.decRef(); // // asset.decRef();
// } // // }
cc.assetManager.releaseAsset(asset); // cc.assetManager.releaseAsset(asset);
asset.destroy(); // asset.destroy();
}); // });
await asyncDelay(0.001);
cc.sys.garbageCollect();
} }
...@@ -541,7 +579,7 @@ export abstract class middleLayerBase extends cc.Component { ...@@ -541,7 +579,7 @@ export abstract class middleLayerBase extends cc.Component {
} }
clearDragonDisplayAssetList() { clearDragonDisplayAssetList() {
return;
console.log('喵喵喵: clearDragonDisplayAssetList'); console.log('喵喵喵: clearDragonDisplayAssetList');
console.log('喵喵喵: ' + this.nodeList.length); console.log('喵喵喵: ' + this.nodeList.length);
......
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