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()});