// 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 { } }
// Use this for initialization void Start() { carCtrl = FindObjectOfType <CarCtrl>(); //questions = qtFile.text.Split("\n"[0]); //answers = ansFile.text.Split("\n"[0]); aleatorio = Random.Range(0, questions.Length - 1); }
// Use this for initialization void Start() { tc_tc = trackedCar.GetComponent <TrackedCarC> (); tc_cc = trackedCar.GetComponent <CarCtrl> (); }
// Use this for initialization void Start () { parrent = GetComponentInParent<CarCtrl>(); }