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.

78 lines
1.7 KiB

  1. using UnityEngine;
  2. using System.Collections;
  3. public class CDscript : MonoBehaviour {
  4. public bool pause = true;
  5. public float startCount = 5.0f;
  6. public GameObject num1;
  7. public GameObject num2;
  8. public GameObject num3;
  9. public GameObject num4;
  10. public GameObject num5;
  11. //public GameObject shat;
  12. // Use this for initialization
  13. void Start () {
  14. pause = true;
  15. }
  16. // Update is called once per frame
  17. void Update () {
  18. if (pause){
  19. startCount -= Time.unscaledDeltaTime;
  20. Time.timeScale = 0;
  21. Debug.Log ("cd");
  22. }
  23. if (startCount > 0) {
  24. //shat.SetActive (false);
  25. }
  26. if (startCount >=4.0f && startCount <= 4.9f){
  27. num5.SetActive(true);
  28. num4.SetActive(false);
  29. num3.SetActive(false);
  30. num2.SetActive(false);
  31. num1.SetActive(false);
  32. }
  33. if (startCount >=3.0f && startCount <= 3.9f){
  34. num5.SetActive(false);
  35. num4.SetActive(true);
  36. num3.SetActive(false);
  37. num2.SetActive(false);
  38. num1.SetActive(false);
  39. }
  40. if (startCount >=2.0f && startCount <= 2.9f){
  41. num5.SetActive(false);
  42. num4.SetActive(false);
  43. num3.SetActive(true);
  44. num2.SetActive(false);
  45. num1.SetActive(false);
  46. }
  47. if (startCount >=1.0f && startCount <= 1.9f){
  48. num5.SetActive(false);
  49. num4.SetActive(false);
  50. num3.SetActive(false);
  51. num2.SetActive(true);
  52. num1.SetActive(false);
  53. }
  54. if (startCount >=0.0f && startCount <= 0.9f){
  55. num5.SetActive(false);
  56. num4.SetActive(false);
  57. num3.SetActive(false);
  58. num2.SetActive(false);
  59. num1.SetActive(true);
  60. }
  61. if (startCount <=0){
  62. num5.SetActive(false);
  63. num4.SetActive(false);
  64. num3.SetActive(false);
  65. num2.SetActive(false);
  66. num1.SetActive(false);
  67. //shat.SetActive(true);
  68. pause = false;
  69. Time.timeScale = 1;
  70. startCount = startCount + 5.0f;
  71. }
  72. }
  73. }