public void ShowQuestion() { //Reset the missed answers text missedAnswerDisplay.text = ""; continueButton.SetActive(false); continueButtonLost.SetActive(false); roundCounter++; summaryDisplay.SetActive(false); winDisplay.SetActive(false); roundEndDisplay.SetActive(false); isRoundActive = true; questionDisplay.SetActive(true); //Start the timer timeRemaining = dataController.getCurrentRoundTime(); UpdateTimeRemainingDisplay(); //Set the starting score playerScore = 0; scoreDisplayText.text = "Score: " + playerScore.ToString(); //Set the round number at the top of screen to current round roundNumberText.text = "Round " + roundCounter; RemoveAnswerButtons(); //Set the current question to a random question questionIndex = unusedQuestions[Random.Range(0, unusedQuestions.Count)]; //Debug.Log ("Current q index = " + questionIndex); Question questionData = questionPool [questionIndex]; questionDisplayText.text = questionData.questions; //Display each answer button if (!next) { for (int i = 0; i < questionData.answers.Length; i++) { GameObject answerButtonGameObject = answerButtonObjectPool.GetObject(); answerButtonGameObjects.Add(answerButtonGameObject); answerButtonGameObject.transform.SetParent(answerButtonParent, false); AnswerButton answerButton = answerButtonGameObject.GetComponent <AnswerButton> (); //Setup the answerButtons on screen answerButton.SetUp(questionData.answers [i]); //Adding the current answers to a list currentAnswers.Add(answerButton.returnAnswer()); next = true; } } else { for (int i = 0; i < questionData.answers.Length; i++) { GameObject answerButtonGameObject = answerButtonObjectPool.GetObject(); answerButtonGameObjects.Add(answerButtonGameObject); answerButtonGameObject.transform.SetParent(answerButtonParent, false); AnswerButton answerButton = answerButtonGameObject.GetComponent <AnswerButton> (); //Setup the answerButtons on screen answerButton.SetUp(questionData.answers [6 - i]); //Adding the current answers to a list currentAnswers.Add(answerButton.returnAnswer()); next = false; } } //Remove the question that has been used from the list unusedQuestions.Remove(questionIndex); }