示例#1
0
    private IEnumerator CountDown()
    {
        float count = secondsToCount;

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

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

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

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