延迟弹出结束
This commit is contained in:
@@ -262,9 +262,9 @@ export class HeroViewComp extends CCComp {
|
|||||||
|
|
||||||
|
|
||||||
do_dead(){
|
do_dead(){
|
||||||
console.log("dead",this.hero_uuid)
|
console.log("角色死亡",this.hero_uuid)
|
||||||
if(this.hero_uuid == 9999){
|
if(this.hero_uuid == 9999){
|
||||||
console.log("mission_loss")
|
console.log("任务失败")
|
||||||
oops.message.dispatchEvent(GameEvent.MissionLoss,this)
|
oops.message.dispatchEvent(GameEvent.MissionLoss,this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,25 +60,28 @@ export class MissionComp extends CCComp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
call_hero(event: string, args: any){
|
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})
|
oops.message.dispatchEvent(GameEvent.CallHero,{uuid:this.hero_args.uuid,pos:args})
|
||||||
this.hero_args=null
|
this.hero_args=null
|
||||||
}
|
}
|
||||||
mission_start(){
|
mission_start(){
|
||||||
/* todo 关卡设定完善*/
|
/* todo 关卡设定完善*/
|
||||||
console.log("战斗开始 Missions mons:",Missions[smc.mission.lv])
|
console.log("战斗开始 关卡怪物:",Missions[smc.mission.lv])
|
||||||
smc.mission.status=1
|
smc.mission.status=1
|
||||||
this.colose_victory()
|
this.colose_victory()
|
||||||
this.mission_init()
|
this.mission_init()
|
||||||
}
|
}
|
||||||
|
|
||||||
mission_end(){
|
mission_end(){
|
||||||
|
// 延迟0.5秒后执行任务结束逻辑
|
||||||
|
this.scheduleOnce(() => {
|
||||||
oops.message.dispatchEvent(GameEvent.MissionEnd)
|
oops.message.dispatchEvent(GameEvent.MissionEnd)
|
||||||
smc.mission.play=false
|
smc.mission.play=false
|
||||||
smc.mission.pause=false
|
smc.mission.pause=false
|
||||||
this.cleanComponents()
|
this.cleanComponents()
|
||||||
// this.to_mission_home()
|
// this.to_mission_home()
|
||||||
this.open_victory()
|
this.open_victory()
|
||||||
|
}, 0.5)
|
||||||
}
|
}
|
||||||
private cleanComponents() {
|
private cleanComponents() {
|
||||||
ecs.query(ecs.allOf(HeroSkillsComp)).forEach(entity => {entity.remove(HeroSkillsComp);entity.destroy()});
|
ecs.query(ecs.allOf(HeroSkillsComp)).forEach(entity => {entity.remove(HeroSkillsComp);entity.destroy()});
|
||||||
|
|||||||
Reference in New Issue
Block a user