From b7a05c2c24870b1610f131a370049668c2086401 Mon Sep 17 00:00:00 2001 From: panw Date: Thu, 29 May 2025 09:21:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BB=B6=E8=BF=9F=E5=BC=B9=E5=87=BA=E7=BB=93?= =?UTF-8?q?=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/script/game/hero/HeroViewComp.ts | 4 ++-- assets/script/game/map/MissionComp.ts | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index d34c589c..909e891c 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -262,9 +262,9 @@ export class HeroViewComp extends CCComp { do_dead(){ - console.log("dead",this.hero_uuid) + console.log("角色死亡",this.hero_uuid) if(this.hero_uuid == 9999){ - console.log("mission_loss") + console.log("任务失败") oops.message.dispatchEvent(GameEvent.MissionLoss,this) } } diff --git a/assets/script/game/map/MissionComp.ts b/assets/script/game/map/MissionComp.ts index bcaca913..28ef0188 100644 --- a/assets/script/game/map/MissionComp.ts +++ b/assets/script/game/map/MissionComp.ts @@ -60,25 +60,28 @@ export class MissionComp extends CCComp { } call_hero(event: string, args: any){ - console.log("call_hero",args) + console.log("召唤英雄",args) oops.message.dispatchEvent(GameEvent.CallHero,{uuid:this.hero_args.uuid,pos:args}) this.hero_args=null } mission_start(){ /* todo 关卡设定完善*/ - console.log("战斗开始 Missions mons:",Missions[smc.mission.lv]) + console.log("战斗开始 关卡怪物:",Missions[smc.mission.lv]) smc.mission.status=1 this.colose_victory() this.mission_init() } mission_end(){ - oops.message.dispatchEvent(GameEvent.MissionEnd) - smc.mission.play=false - smc.mission.pause=false + // 延迟0.5秒后执行任务结束逻辑 + this.scheduleOnce(() => { + oops.message.dispatchEvent(GameEvent.MissionEnd) + smc.mission.play=false + smc.mission.pause=false this.cleanComponents() // this.to_mission_home() this.open_victory() + }, 0.5) } private cleanComponents() { ecs.query(ecs.allOf(HeroSkillsComp)).forEach(entity => {entity.remove(HeroSkillsComp);entity.destroy()});