Browse Source

Scheduler.enableForTarget(this);

woso_javan 2 months ago
parent
commit
21b5f74927
1 changed files with 3 additions and 0 deletions
  1. 3 0
      assets/module_storm_sunder/Script/Manager/TimerMgr.ts

+ 3 - 0
assets/module_storm_sunder/Script/Manager/TimerMgr.ts

@@ -41,6 +41,7 @@ export class TimerMgr {
             this.upateLbTime();
         }, 1000); // 每秒减少一次
 
+        Scheduler.enableForTarget(this);
         director.getScheduler().schedule(this.update, this, 0);
     }
 
@@ -72,9 +73,11 @@ export class TimerMgr {
     // 销毁时清理
     public reset(): void {
         this.stopCountdown();
+        Scheduler.enableForTarget(this);
         director.getScheduler().unscheduleAllForTarget(this);
 
         const mapConfig = MapMgr.Instance.getMapConfig(1);
         this.countDownTime = mapConfig.time;
+        this.countDownTime = 10; //测试
     }
 }