Commit cbc1ecfa authored by limingzhe's avatar limingzhe

fix: debug

parent 43942fbf
......@@ -692,7 +692,21 @@ export default class middleLayer extends cc.Component {
// 递归处理
this.clearPrefabs(child);
});
}
}
clearGraphics(node) {
node.children.forEach(child => {
// 如果节点有 Graphics 组件
let graphics = child.getComponent(cc.Graphics);
if (graphics) {
graphics.node.destroy();
cc.log("释放 Graphics 节点:", child.name);
}
// 递归处理子节点
this.clearGraphics(child);
});
}
// -----------------------------------------------
......@@ -702,6 +716,9 @@ export default class middleLayer extends cc.Component {
cc.audioEngine.stopAll();
this.getDragonDisplayAssetList(cc.find('Canvas'));
this.clearPrefabs(cc.find('Canvas'));
this.clearGraphics(cc.find('Canvas'));
const scene = cc.director.getScene();
......
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