public void StartCountdown(int from, MyCountdownTimer.TimerFinished tf)
 {
     currentFrame = from - 1;
     sprites[currentFrame].enabled = true;
     finishedCallback = tf;
     isStarted        = true;
     timer.StartTimer(from, 1, 1, OnCountdownInterval, OnTimerFinished);
 }
示例#2
0
    public void StartRound(int seconds, MyCountdownTimer.TimerElapsedCallback te, MyCountdownTimer.TimerFinished tf)
    {
        if (!isRoundStarted)
        {
            Debug.Log("start round");
            roundTime = seconds;

            finishedCallback = tf;
            intervalCallback = te;

            timeRemaining  = roundTime;
            isRoundStarted = true;

            //timeDisplay.enabled = true;//works: shows the display
            timeDisplay.SetText((timeRemaining).ToString());

            countdownTimer.StartTimer(timeRemaining, 1, 1, TimerElapsed, TimerFinished);
        }
    }