I have a GameDataEditor. I entry my questions by this but I want to toggle bool when a question asked. so if a question asked, then “asked” bool will true and never seem in game. the questions asking as random. Is it possible make it?
public void ShowQuestions()
{
currentRoundData = dataController.GetCurrentRoundData();
questionPool = currentRoundData.questions;
questionIndex = Random.Range(0, questionPool.Count);
if (!questionPool[questionIndex].asked)
{
questionData = questionPool[questionIndex];
questionDisplay.GetComponentInChildren<TextMeshProUGUI>().text = questionData.question;
}
else{
questionIndex = Random.Range(0, questionPool.Count);
}
}
public void Close()
{
questionPool[questionIndex].asked = true;
}
Close method is a button method.