예제 #1
0
 /// <summary>
 /// Stops the coroutine for the timer so that it no longer increases
 /// However, it does keep its current state so that it can be resumed
 /// </summary>
 /// <param name="timer"></param>
 public void PauseTimer(CoolDownTimer timer)
 {
     if (timer != null && timer.IsRunning)
     {
         timer.StopTimer();
         StopCoroutine(timer.TimerRoutine());
     }
 }
예제 #2
0
    /// <summary>
    /// Helps with garbage collection forcing all coroutines to stop when the unit is not
    /// active which usually means the unit is dead
    /// </summary>
    protected void StopAll()
    {
        StopAllCoroutines();

        if (m_attackTimer != null)
        {
            m_attackTimer.StopTimer();
        }

        if (m_specialTimer != null)
        {
            m_specialTimer.StopTimer();
        }
    }