IEnumerator CountStart() { Controls.disableControls(); Timer.SetActive(false); yield return(new WaitForSeconds(0.5f)); CountD.GetComponent <Text> ().text = "3"; GetR.Play(); CountD.SetActive(true); yield return(new WaitForSeconds(1)); CountD.SetActive(false); CountD.GetComponent <Text> ().text = "2"; GetR.Play(); CountD.SetActive(true); yield return(new WaitForSeconds(1)); CountD.SetActive(false); CountD.GetComponent <Text> ().text = "1"; GetR.Play(); CountD.SetActive(true); yield return(new WaitForSeconds(1)); CountD.SetActive(false); Go.Play(); Timer.SetActive(true); Controls.enableControls(); }
// Update is called once per frame void Update() { if (answers[aleatorio] == answer.text) { a.text = ""; if (carCtrl) { print("Correcto"); score.gainPoints(); Controls.SetActive(true); q.SetActive(false); a.gameObject.SetActive(false); panel.SetActive(false); carCtrl.enableControls(); particle1.SetActive(false); Destroy(particle1); } else { score.gainPoints(); carCtrl = FindObjectOfType <CarCtrl>(); Controls.SetActive(true); q.SetActive(false); a.gameObject.SetActive(false); panel.SetActive(false); carCtrl.enableControls(); particle1.SetActive(false); } Destroy(gameObject); } else { } }