diff --git a/assets/script/game/map/MissionComp.ts b/assets/script/game/map/MissionComp.ts index 00827117..8734ea4e 100644 --- a/assets/script/game/map/MissionComp.ts +++ b/assets/script/game/map/MissionComp.ts @@ -52,6 +52,10 @@ export class MissionComp extends CCComp { 1:{uuid:0,count:0}, 2:{uuid:0,count:0}, } + + func_queue:any=[] + + onLoad(){ this.on(GameEvent.MissionStart,this.mission_start,this) this.on(GameEvent.MasterCalled,this.ready_to_fight,this) @@ -63,9 +67,8 @@ export class MissionComp extends CCComp { this.on(GameEvent.DO_AD_BACK,this.do_ad,this) // this.on(GameEvent.CanUpdateLv,this.show_uplv_button,this) this.on(GameEvent.UseHeroCard,this.hero_called,this) - } - + protected update(dt: number): void { if(!smc.mission.play||smc.mission.pause){ return @@ -81,7 +84,6 @@ export class MissionComp extends CCComp { this.run_time() } } - // if(this.is_in_wave){ // if(this.wave_time_cd.update(dt)){ // smc.vmdata.mission_data.wave_time_num-- @@ -206,9 +208,9 @@ export class MissionComp extends CCComp { this.time_num=FightSet.DOWN_TIME this.node.getChildByName("time").active=true this.is_show_time=true + this.run_time() this.next_func=onHide } - hide_time(){ if(this.next_func){ this.next_func() @@ -216,8 +218,14 @@ export class MissionComp extends CCComp { this.node.getChildByName("time").active=false this.is_show_time=false this.next_func=undefined + this.time_cd.reset() + } + clear_time(){ + this.node.getChildByName("time").active=false + this.is_show_time=false + this.next_func=undefined + this.time_cd.reset() } - run_time(){ this.node.getChildByName("time").setScale(0,0,0) tween(this.node.getChildByName("time")) @@ -235,9 +243,6 @@ export class MissionComp extends CCComp { async mission_start(){ console.log("[MissionComp] ** 1 ** mission_start") - // 撤销所有正在运行的scheduleOnce函数 - this.unscheduleAllCallbacks() - this.node.getChildByName("ending").getComponent(Animation).play("startFight") oops.message.dispatchEvent(GameEvent.FightReady) this.node.active=true @@ -321,7 +326,7 @@ export class MissionComp extends CCComp { 1:{uuid:0,count:0}, 2:{uuid:0,count:0}, } - this.hide_time() + this.clear_time() this.hide_wave_time() this.tals={ 0:false,