hey. i did the challenge a bit differently and its working, my code is shorter and looks cleaner i think.
my code is:
{
public void OnAnswereSelected(int index)
{
if (index==question.GetCorrectAnswerIndex())
{
questionText.text = "Correct";
Image buttonImage = answerButtons[correctAnsverIndex].GetComponent<Image>();
buttonImage.sprite = correctAnswareSprite;
}
else
{
**questionText.text = "wrong, the correct answer was\n"+ question.GetAnswer(correctAnsverIndex);**
Image buttonImage = answerButtons[correctAnsverIndex].GetComponent<Image>();
buttonImage.sprite = correctAnswareSprite;
}
}
instead of in the video where he is using a variable to get the correctanswer string.
is there any drawbacks doing it this way?