From af16f581dd3ebd96ba5320215012ba638a91643a Mon Sep 17 00:00:00 2001 From: panw Date: Wed, 6 Aug 2025 15:36:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=AE=E5=89=8D=E6=B2=A1=E6=9C=89=E9=94=99?= =?UTF-8?q?=E8=AF=AF,=E4=B8=8D=E9=9C=80=E8=A6=81=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=AE=A1=E6=97=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/script/game/map/MissionComp.ts | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) 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,