目前没有错误,不需要添加自定义计时器
This commit is contained in:
@@ -52,6 +52,10 @@ export class MissionComp extends CCComp {
|
|||||||
1:{uuid:0,count:0},
|
1:{uuid:0,count:0},
|
||||||
2:{uuid:0,count:0},
|
2:{uuid:0,count:0},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func_queue:any=[]
|
||||||
|
|
||||||
|
|
||||||
onLoad(){
|
onLoad(){
|
||||||
this.on(GameEvent.MissionStart,this.mission_start,this)
|
this.on(GameEvent.MissionStart,this.mission_start,this)
|
||||||
this.on(GameEvent.MasterCalled,this.ready_to_fight,this)
|
this.on(GameEvent.MasterCalled,this.ready_to_fight,this)
|
||||||
@@ -63,7 +67,6 @@ export class MissionComp extends CCComp {
|
|||||||
this.on(GameEvent.DO_AD_BACK,this.do_ad,this)
|
this.on(GameEvent.DO_AD_BACK,this.do_ad,this)
|
||||||
// this.on(GameEvent.CanUpdateLv,this.show_uplv_button,this)
|
// this.on(GameEvent.CanUpdateLv,this.show_uplv_button,this)
|
||||||
this.on(GameEvent.UseHeroCard,this.hero_called,this)
|
this.on(GameEvent.UseHeroCard,this.hero_called,this)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected update(dt: number): void {
|
protected update(dt: number): void {
|
||||||
@@ -81,7 +84,6 @@ export class MissionComp extends CCComp {
|
|||||||
this.run_time()
|
this.run_time()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if(this.is_in_wave){
|
// if(this.is_in_wave){
|
||||||
// if(this.wave_time_cd.update(dt)){
|
// if(this.wave_time_cd.update(dt)){
|
||||||
// smc.vmdata.mission_data.wave_time_num--
|
// smc.vmdata.mission_data.wave_time_num--
|
||||||
@@ -206,9 +208,9 @@ export class MissionComp extends CCComp {
|
|||||||
this.time_num=FightSet.DOWN_TIME
|
this.time_num=FightSet.DOWN_TIME
|
||||||
this.node.getChildByName("time").active=true
|
this.node.getChildByName("time").active=true
|
||||||
this.is_show_time=true
|
this.is_show_time=true
|
||||||
|
this.run_time()
|
||||||
this.next_func=onHide
|
this.next_func=onHide
|
||||||
}
|
}
|
||||||
|
|
||||||
hide_time(){
|
hide_time(){
|
||||||
if(this.next_func){
|
if(this.next_func){
|
||||||
this.next_func()
|
this.next_func()
|
||||||
@@ -216,8 +218,14 @@ export class MissionComp extends CCComp {
|
|||||||
this.node.getChildByName("time").active=false
|
this.node.getChildByName("time").active=false
|
||||||
this.is_show_time=false
|
this.is_show_time=false
|
||||||
this.next_func=undefined
|
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(){
|
run_time(){
|
||||||
this.node.getChildByName("time").setScale(0,0,0)
|
this.node.getChildByName("time").setScale(0,0,0)
|
||||||
tween(this.node.getChildByName("time"))
|
tween(this.node.getChildByName("time"))
|
||||||
@@ -235,9 +243,6 @@ export class MissionComp extends CCComp {
|
|||||||
async mission_start(){
|
async mission_start(){
|
||||||
console.log("[MissionComp] ** 1 ** mission_start")
|
console.log("[MissionComp] ** 1 ** mission_start")
|
||||||
|
|
||||||
// 撤销所有正在运行的scheduleOnce函数
|
|
||||||
this.unscheduleAllCallbacks()
|
|
||||||
|
|
||||||
this.node.getChildByName("ending").getComponent(Animation).play("startFight")
|
this.node.getChildByName("ending").getComponent(Animation).play("startFight")
|
||||||
oops.message.dispatchEvent(GameEvent.FightReady)
|
oops.message.dispatchEvent(GameEvent.FightReady)
|
||||||
this.node.active=true
|
this.node.active=true
|
||||||
@@ -321,7 +326,7 @@ export class MissionComp extends CCComp {
|
|||||||
1:{uuid:0,count:0},
|
1:{uuid:0,count:0},
|
||||||
2:{uuid:0,count:0},
|
2:{uuid:0,count:0},
|
||||||
}
|
}
|
||||||
this.hide_time()
|
this.clear_time()
|
||||||
this.hide_wave_time()
|
this.hide_wave_time()
|
||||||
this.tals={
|
this.tals={
|
||||||
0:false,
|
0:false,
|
||||||
|
|||||||
Reference in New Issue
Block a user