Exemplo n.º 1
0
    private IEnumerator DecrementTimer(int seconds, ITimeable callback)
    {
        this.seconds = seconds;

        callback.OnStartTimer();

        while (this.seconds > 0)
        {
            yield return(new WaitForSeconds(1f));

            this.seconds--;
            callback.OnIncrementTimer();
        }

        callback.OnFinishTimer();
    }