Advertisement
Guest User

Untitled

a guest
May 6th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1.  private bool waitCheck = true;    
  2.  
  3.     IEnumerator waitFiveSeconds()
  4.     {
  5.         if (waitCheck)
  6.         {
  7.             waitCheck = false;
  8.             yield return new WaitForSeconds(5);
  9.             waitCheck = true;
  10.         }
  11.         Debug.Log("im waiting for five");
  12.     }
  13.  
  14.     void Start ()
  15.     {
  16.         while (Ball.gameScore > 0)
  17.         {
  18.             int randomNum = Random.Range(0, 10);
  19.  
  20.             Debug.Log("Number " + (randomNum + 1).ToString());
  21.             GetComponent<Text>().text = scoreTextList[randomNum];
  22.             StartCoroutine("waitFiveSeconds");
  23.  
  24.             Ball.gameScore--;
  25.         }
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement