Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IEnumerator waitFiveSeconds()
- {
- if (waitCheck == true)
- {
- waitCheck = false;
- yield return new WaitForSeconds(5);
- Debug.Log("I've waited five seconds.");
- waitCheck = true;
- rollCheck = true;
- Debug.Log("RollCheck has finally been updated.");
- }
- }
- void Start()
- {
- }
- void Update()
- {
- Debug.Log("rollCheck is: " + rollCheck.ToString());
- if (Ball.gameScore > 0 && rollCheck == true)
- {
- rollCheck = false;
- Debug.Log("rollCheck is now: " + rollCheck.ToString());
- int randomNum = Random.Range(0, 10);
- Debug.Log("Number " + (randomNum + 1).ToString());
- Debug.Log("UI Text says: " + GetComponent<Text>().text);
- GetComponent<Text>().text = scoreTextList[randomNum];
- Debug.Log("UI Text says: " + GetComponent<Text>().text);
- StartCoroutine("waitFiveSeconds");
- Ball.gameScore--;
- }
- Debug.Log("rollcheck is finally: " + rollCheck.ToString());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement