You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

80 lines
1.7 KiB

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;
//public GameObject shat;
// Use this for initialization
void Start () {
pause = true;
Time.timeScale = 0.0f;
}
// Update is called once per frame
void Update () {
if (pause){
startCount -= Time.unscaledDeltaTime;
Time.timeScale = 0;
Debug.Log ("cd");
}
if (startCount > 0) {
//shat.SetActive (false);
}
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);
//shat.SetActive(true);
pause = false;
Time.timeScale = 1;
startCount = startCount + 5.0f;
}
}
}