fix: 修复组件销毁时事件解绑和空引用问题并添加任务界面

- 在多个组件的onDestroy方法中添加节点有效性检查,防止无效节点上解绑事件
- 修复MissionComp中任务启动逻辑,改为通过UI打开方式触发MissionStart事件
- 添加新的任务界面(UIID.Mission)及相关配置
- 修复MissionCardComp中Map未初始化导致的空引用问题
- 优化按钮事件绑定和解绑逻辑,增加空值检查
This commit is contained in:
panw
2026-05-08 14:14:38 +08:00
parent c70e3bbb4d
commit 07aec09283
16 changed files with 19665 additions and 19580 deletions

View File

@@ -94,7 +94,9 @@ export class SkillBoxComp extends CCComp {
onDestroy() {
oops.message.off(GameEvent.FightStart, this.onFightStart, this);
oops.message.off(GameEvent.MissionEnd, this.onMissionEnd, this);
this.node.off(GameEvent.NewWave, this.onNewWave, this);
if (this.node && this.node.isValid) {
this.node.off(GameEvent.NewWave, this.onNewWave, this);
}
oops.message.off(GameEvent.NewWave, this.onNewWaveGlobal, this);
// 通知 MissSkillsComp 回收该节点占用的槽位
oops.message.dispatchEvent(GameEvent.RemoveSkillBox, this.node);