diff --git a/assets/script/game/map/MissionComp.ts b/assets/script/game/map/MissionComp.ts index 8e0a9d9c..da4ef3aa 100644 --- a/assets/script/game/map/MissionComp.ts +++ b/assets/script/game/map/MissionComp.ts @@ -77,12 +77,13 @@ export class MissionComp extends CCComp { // 记录已触发的特殊刷怪索引 onLoad(){ + this.showMemoryPanel = false this.on(GameEvent.MissionStart,this.mission_start,this) // this.on(GameEvent.HeroDead,this.do_hero_dead,this) // this.on(GameEvent.FightEnd,this.fight_end,this) this.on(GameEvent.MissionEnd,this.mission_end,this) this.on(GameEvent.DO_AD_BACK,this.do_ad,this) - this.initMemoryPanel() + this.removeMemoryPanel() } protected update(dt: number): void { if(!smc.mission.play) return @@ -94,7 +95,6 @@ export class MissionComp extends CCComp { this.FightTime-=dt // 检查特殊刷怪时间 this.update_time(); - this.updateMemoryPanel(dt); } } update_time(){ @@ -331,6 +331,15 @@ export class MissionComp extends CCComp { this.memoryLabel = label; } + private removeMemoryPanel() { + const panel = this.time_node?.getChildByName("mem_panel"); + if (panel) { + panel.destroy(); + } + this.memoryLabel = null; + this.lastMemoryText = ""; + } + private updateMemoryPanel(dt: number) { if (!this.showMemoryPanel || !this.memoryLabel) return;