Commit de075337 authored by limingzhe's avatar limingzhe

fix: debug 清缓存

parent b948676e
...@@ -194,6 +194,7 @@ export abstract class middleLayerBase extends cc.Component { ...@@ -194,6 +194,7 @@ export abstract class middleLayerBase extends cc.Component {
console.log('喵喵喵4: ' + this.textureList.length); console.log('喵喵喵4: ' + this.textureList.length);
this.loadBundleLock = true; // 加锁 this.loadBundleLock = true; // 加锁
this.currentBundleInfo = { sceneName, version, bondleUrl }; this.currentBundleInfo = { sceneName, version, bondleUrl };
console.log("[middleLayer_for_NJ_lite]-[loadBundle] currentBundleInfo=", JSON.stringify(this.currentBundleInfo)) console.log("[middleLayer_for_NJ_lite]-[loadBundle] currentBundleInfo=", JSON.stringify(this.currentBundleInfo))
...@@ -410,7 +411,6 @@ export abstract class middleLayerBase extends cc.Component { ...@@ -410,7 +411,6 @@ export abstract class middleLayerBase extends cc.Component {
clearDragonDisplayAssetList() { clearDragonDisplayAssetList() {
console.log('喵喵喵: clearDragonDisplayAssetList'); console.log('喵喵喵: clearDragonDisplayAssetList');
console.log('喵喵喵: ' + this.nodeList.length); console.log('喵喵喵: ' + this.nodeList.length);
...@@ -418,41 +418,20 @@ export abstract class middleLayerBase extends cc.Component { ...@@ -418,41 +418,20 @@ export abstract class middleLayerBase extends cc.Component {
console.log('喵喵喵: ' + this.assetList.length); console.log('喵喵喵: ' + this.assetList.length);
console.log('喵喵喵: ' + this.textureList.length); console.log('喵喵喵: ' + this.textureList.length);
[...this.atlasList, ...this.assetList].forEach(asset => {
asset.decRef();
cc.assetManager.releaseAsset(asset);
this.textureList.forEach(texture => {
while (texture?.refCount) {
texture?.decRef();
}
});
[...this.atlasList].forEach(asset => {
asset.destroy(); asset.destroy();
while (asset?.refCount) {
asset?.decRef();
}
// cc.assetManager.releaseAsset(asset);
}); });
[...this.assetList].forEach(asset => {
asset.destroy();
while (asset?.refCount) {
asset?.decRef();
}
// cc.assetManager.releaseAsset(asset);
});
this.nodeList.forEach(node => { this.nodeList.forEach(node => {
node.active = false; node.active = false;
node.removeFromParent(); node.removeFromParent();
}); });
this.textureList.forEach(texture => {
texture.decRef();
});
} }
nodeList = null; nodeList = null;
...@@ -460,14 +439,12 @@ export abstract class middleLayerBase extends cc.Component { ...@@ -460,14 +439,12 @@ export abstract class middleLayerBase extends cc.Component {
assetList = null; assetList = null;
textureList = null; textureList = null;
getDragonDisplayAssetList(node) { getDragonDisplayAssetList(node) {
const dragonDisplay = node.getComponent(dragonBones.ArmatureDisplay); const dragonDisplay = node.getComponent(dragonBones.ArmatureDisplay);
if (dragonDisplay) { if (dragonDisplay) {
const atlas = dragonDisplay.dragonAtlasAsset; const atlas = dragonDisplay.dragonAtlasAsset;
const asset = dragonDisplay.dragonAsset; const asset = dragonDisplay.dragonAsset;
if (atlas && atlas.texture) { if (atlas.texture) {
if (atlas.texture.nativeUrl.includes('h5template')) { if (atlas.texture.nativeUrl.includes('h5template')) {
node.children.forEach(child => { node.children.forEach(child => {
this.getDragonDisplayAssetList(child); this.getDragonDisplayAssetList(child);
......
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