refactor(map): 为所有组件的onDestroy添加父类调用

统一修复组件销毁时未调用父类生命周期方法的问题,确保资源正确释放
This commit is contained in:
panw
2026-05-13 16:03:53 +08:00
parent 7cb07c04dd
commit 2443dfce85
12 changed files with 12 additions and 1 deletions

View File

@@ -84,6 +84,7 @@ export class MissSkillsComp extends CCComp {
/** 移除事件监听 */
onDestroy() {
super.onDestroy();
oops.message.off(GameEvent.UseSkillCard, this.onUseSkillCard, this);
oops.message.off(GameEvent.RemoveSkillBox, this.onRemoveSkillBox, this);
}