コード例 #1
0
ファイル: Timer.cs プロジェクト: xdidx/gta-demago
 private void stop()
 {
     if (isInProgress)
     {
         this.interrupt();
         OnTimerStop?.Invoke(this);
     }
 }
コード例 #2
0
    private IEnumerator CountDown()
    {
        float count = secondsToCount;

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

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

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

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