- Home /
Question by
rchanglee17 · Nov 12, 2019 at 08:41 AM ·
timercountdown
how to stop countdown timer after move panel ? how to fix this ?,can you tell me how to stop countdown timer after move panel ? how to fix this ?
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.SceneManagement;
public class Timer34 : MonoBehaviour { int countDownStartValue = 150; public Text timerUI;
[SerializeField]
public string sceneNameToLoad;
void Start()
{
countDownTimer();
}
void countDownTimer()
{
if(countDownStartValue > 0)
{
TimeSpan spanTime = TimeSpan.FromSeconds(countDownStartValue);
timerUI.text = spanTime.Minutes + " : " + spanTime.Seconds;
countDownStartValue--;
Invoke("countDownTimer", 1.0f);
}
else
{
SceneManager.LoadScene(sceneNameToLoad);
}
}
}
Comment
Your answer
Follow this Question
Related Questions
How to stop a countdown from counting down 1 Answer
countdown timer acivation 1 Answer
How to restart a level with countdown? 4 Answers
Countdown Timer or WaitForSeconds? 2 Answers
countdown timer on for example a wall of a building in your game? 2 Answers