Commit 61ccde9e authored by liujiaxin's avatar liujiaxin

1

parent ddb14d82
...@@ -222,7 +222,7 @@ export default class PengPeng extends cc.Component { ...@@ -222,7 +222,7 @@ export default class PengPeng extends cc.Component {
const animationName = meta['animation']; const animationName = meta['animation'];
const properties = meta['node']; const properties = meta['node'];
const offset = meta['offset']; const offset = meta['offset'];
console.log(nodeName, armatureName, node) console.log(nodeName, armatureName, node)
pg.load.loadAssets([ pg.load.loadAssets([
...@@ -237,23 +237,29 @@ export default class PengPeng extends cc.Component { ...@@ -237,23 +237,29 @@ export default class PengPeng extends cc.Component {
// dragonDisplay.dragonAtlasAsset.destroy(); // dragonDisplay.dragonAtlasAsset.destroy();
// dragonDisplay.dragonAsset.destroy(); // dragonDisplay.dragonAsset.destroy();
let c1 = false;
let c2 = false;
if (u1 && typeof u1 == 'string' && u1.startsWith('http')) { if (u1 && typeof u1 == 'string' && u1.startsWith('http')) {
console.log('release1', u1) console.log('release1', u1)
dragonDisplay.dragonAtlasAsset.destroy(); dragonDisplay.dragonAtlasAsset.destroy();
cc.assetManager.releaseAsset(dragonDisplay.dragonAtlasAsset.texture); cc.assetManager.releaseAsset(dragonDisplay.dragonAtlasAsset.texture);
cc.assetManager.releaseAsset(u1); cc.assetManager.releaseAsset(u1);
c1 = true;
} }
if (u2 && typeof u2 == 'string' && u2.startsWith('http')) { if (u2 && typeof u2 == 'string' && u2.startsWith('http')) {
console.log('release1', u2) console.log('release1', u2)
dragonDisplay.dragonAsset.destroy(); dragonDisplay.dragonAsset.destroy();
cc.assetManager.releaseAsset(u2); cc.assetManager.releaseAsset(u2);
c2 = true;
} }
const currentArmature = dragonDisplay.armature() if (c1 && c2) {
if (currentArmature) { const currentArmature = dragonDisplay.armature()
currentArmature.dispose() if (currentArmature) {
currentArmature.dispose()
}
} }
dragonDisplay.dragonAsset = null; dragonDisplay.dragonAsset = null;
dragonDisplay.dragonAtlasAsset = null; dragonDisplay.dragonAtlasAsset = null;
dragonDisplay.armatureName = ""; dragonDisplay.armatureName = "";
......
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