Пример #1
0
 public void UnPauseTimer(TimerHandle handle)
 {
     if (handle.IsActive)
     {
         activeTimers[handle].timerStatus = ETimerStatus.Active;
         activeTimers[handle].expireTime += Time.time;
     }
 }
Пример #2
0
 public void PauseTimer(TimerHandle handle)
 {
     if (handle.IsActive)
     {
         activeTimers[handle].timerStatus = ETimerStatus.Paused;
         activeTimers[handle].expireTime -= Time.time;
     }
 }
Пример #3
0
 public void SetTimer(TimerHandle handle, Action action, float timerRate, bool isLooping = false, float firstDelay = 0.0f)
 {
     if (!handle.IsActive)
     {
         handle.IsActive = true;
         TimerData newTimerData = new TimerData(isLooping, ETimerStatus.Active, timerRate, Time.time + timerRate + firstDelay, action);
         activeTimers.Add(handle, newTimerData);
     }
 }
Пример #4
0
 public void StopTimer(TimerHandle handle)
 {
     if (handle.IsActive)
     {
         if (activeTimers.ContainsKey(handle))
         {
             activeTimers[handle].timerStatus = ETimerStatus.PendingRemoval;
         }
     }
 }
Пример #5
0
 private void RemoveTimer(TimerHandle handle)
 {
     activeTimers.Remove(handle);
     handle.IsActive = false;
 }