using UnityEngine; using System.Collections; public class CDscript : MonoBehaviour { public bool pause = true; public float startCount = 5.0f; public GameObject num1; public GameObject num2; public GameObject num3; public GameObject num4; public GameObject num5; // Use this for initialization void Start () { pause = true; } // Update is called once per frame void Update () { if (pause){ startCount -= Time.unscaledDeltaTime; Time.timeScale = 0; Debug.Log ("cd"); } if (startCount >=4.0f && startCount <= 4.9f){ num5.SetActive(true); num4.SetActive(false); num3.SetActive(false); num2.SetActive(false); num1.SetActive(false); } if (startCount >=3.0f && startCount <= 3.9f){ num5.SetActive(false); num4.SetActive(true); num3.SetActive(false); num2.SetActive(false); num1.SetActive(false); } if (startCount >=2.0f && startCount <= 2.9f){ num5.SetActive(false); num4.SetActive(false); num3.SetActive(true); num2.SetActive(false); num1.SetActive(false); } if (startCount >=1.0f && startCount <= 1.9f){ num5.SetActive(false); num4.SetActive(false); num3.SetActive(false); num2.SetActive(true); num1.SetActive(false); } if (startCount >=0.0f && startCount <= 0.9f){ num5.SetActive(false); num4.SetActive(false); num3.SetActive(false); num2.SetActive(false); num1.SetActive(true); } if (startCount <=0){ num5.SetActive(false); num4.SetActive(false); num3.SetActive(false); num2.SetActive(false); num1.SetActive(false); pause = false; Time.timeScale = 1; startCount = startCount + 5.0f; } } }