Good day, how to make a normal timer, for example, from 10 seconds to 0, and after finishing it started counting again from 10 to 0. I would be very grateful if you wrote the code, unity just started to learn. Tried to search on the Internet Unity constantly gives errors. I do in Unity 5.
1 answer
float time = .0f; IEnumerator Timer () { time = 10.0f while (time > 0.0f) { time -= Time.deltaTime; yield return new WaitForFixedUpdate (); } Debug.Log ("done"); StartCoroutine (Timer()); yield return null; } - Try to write more detailed answers. Explain what is the basis of your statement? - Nicolas Chabanovsky ♦
|
C#orjavascript. write at the beginning on it, and then do with it whatever you want in the unit - Alexey Shimansky