Ejemplo n.º 1
0
 private void showQuestion()
 {
     foreach (GameObject obj in GameObject.FindGameObjectsWithTag("QuestionBall"))
     {
         QuestionBall q = obj.GetComponent <QuestionBall> ();
         foreach (TextMeshProUGUI text in obj.GetComponentsInChildren <TextMeshProUGUI> ())
         {
             text.SetText(q.question.question.ToString());
         }
     }
 }
Ejemplo n.º 2
0
    public void go()
    {
        foreach (GameObject obj in GameObject.FindGameObjectsWithTag("QuestionBall"))
        {
            QuestionBall q = obj.GetComponent <QuestionBall> ();
            if (q.question.verify(answer))
            {
                playSfx(ballExplodeSfx);
                score        += q.question.score;
                scoreTxt.text = (score).ToString();

                Debug.Log(q.question.explaination + ", Score " + q.question.score);

                clear();
                Destroy(obj);
//				StartCoroutine(delayDestroy (obj));
                return;
            }
        }
        badAnswer();
    }