Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.UI;
- using System.Collections;
- public class CountDown : MonoBehaviour {
- float timer = 3;
- string getReady = "3";
- bool isReady = true;
- // Use this for initialization
- void Start ()
- {
- StartCoroutine (getReady);
- }
- // Update is called once per frame
- void Update ()
- {
- timer-=Time.deltaTime;
- }
- IEnumerator getReady()
- {
- isReady = true;
- getReady = "3";
- yield return new WaitForSeconds(0.5f);
- getReady = "2";
- yield return new WaitForSeconds(0.5f);
- getReady = "1";
- yield return new WaitForSeconds(0.5f);
- getReady = "GO";
- yield return new WaitForSeconds(0.5f);
- getReady = "";
- isReady = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement