public void CheckAns(int choice) { isRoundActive = false; //Locks the user's choice by making all buttons not clickable for (int i = 0; i < currentRoundData.questions[currQidx].ansChoice.Length; ++i) { choiceButtons[i].interactable = false; } if (choice != qData[currQidx].CorrectAns) //Checks if the chosen answer is correct { //When player chooses the wrong answer, shows the correct answer and marks player's answer as wrong and //enemy atacks choiceButtons[choice - 1].GetComponent <Image>().sprite = wrongButtonImage; for (int i = 0; i < choiceButtons.Length; ++i) { if (i == qData[currQidx].CorrectAns - 1) { choiceButtons[i].GetComponent <Image>().sprite = correctButtonImage; } } _turnController.EnemyAttack(); } else { //When player chooses the correct answer, increase user's score and player attacks score += (int)timeRemaining; choiceButtons[choice - 1].GetComponent <Image>().sprite = correctButtonImage; _turnController.PlayerAttack(); } }