Commit 5a256e72 authored by limingzhe's avatar limingzhe
parents 7ed521f7 0872c8a6
......@@ -416,7 +416,7 @@ export abstract class middleLayerBase extends cc.Component {
async clearDragonDisplayAssetList() {
async clearDragonDisplayAssetList3() {
console.log('喵喵喵: clearDragonDisplayAssetList');
console.log('喵喵喵: ' + this.nodeList.length);
......@@ -513,7 +513,7 @@ export abstract class middleLayerBase extends cc.Component {
}
// 原始方法
clearDragonDisplayAssetList2() {
......@@ -534,9 +534,37 @@ export abstract class middleLayerBase extends cc.Component {
node.removeFromParent();
});
this.textureList.forEach(texture => {
texture.decRef();
});
}
clearDragonDisplayAssetList() {
console.log('喵喵喵: clearDragonDisplayAssetList');
console.log('喵喵喵: ' + this.nodeList.length);
console.log('喵喵喵: ' + this.atlasList.length);
console.log('喵喵喵: ' + this.assetList.length);
console.log('喵喵喵: ' + this.textureList.length);
[ ...this.atlasList , ...this.assetList].forEach(asset => {
asset.decRef();
cc.assetManager.releaseAsset(asset);
cc.sys.garbageCollect()
asset.destroy();
});
this.nodeList.forEach(node => {
node.active = false;
node.removeFromParent();
});
this.textureList.forEach(texture => {
texture.decRef();
cc.assetManager.releaseAsset(texture);
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