Exemple #1
0
        static TimerUtil()
        {
            RealTimer   = new PromiseTimer();
            ScaledTimer = new PromiseTimer();

            MonoAgent.Inst.OnUpdate += UpdateTimer;
        }
Exemple #2
0
 void Start() {
     promiseTimer = new UndoablePromiseTimer(() => gameTime);
     stoppablePromiseTimer = new UndoablePromiseTimer(() => stoppableGameTime);
     gameTime = 0;
     timeSubstitution = DynamicTextManager.instance.Substitute("#{gameTime}", () => {
         var span = TimeSpan.FromSeconds(stoppableGameTime);
         var result = string.Format("{0}:{1:00}.{2:00}", (int)span.TotalMinutes, span.Seconds, span.Milliseconds/10);
         if (Time.timeScale != 1) {
             result += string.Format(" (x{0:f1})", Time.timeScale);
         }
         return result;
     });
     new BoolTracker(v => timestopped = v, () => timestopped);
     new ValueTracker<float>(v => stoppableGameTime = gameTime + v, () => stoppableGameTime - gameTime);
 }
Exemple #3
0
 public PromiseTimerService()
 {
     _promiseTimer = new RSG.PromiseTimer();
 }