Exemple #1
0
 private void stop()
 {
     if (isInProgress)
     {
         this.interrupt();
         OnTimerStop?.Invoke(this);
     }
 }
Exemple #2
0
    private IEnumerator CountDown()
    {
        float count = secondsToCount;

        while (count > 0f)
        {
            yield return(new WaitForSeconds(tickTime));

            count--;
            OnChangeTime?.Invoke(count);
        }
        OnTimerStop?.Invoke();
    }
Exemple #3
0
    private IEnumerator CountUp()
    {
        float count = 0f;

        while (count < secondsToCount)
        {
            yield return(new WaitForSeconds(tickTime));

            count++;
            OnChangeTime?.Invoke(count);
        }
        OnTimerStop?.Invoke();
    }