I've created a simple 2d game like a questionnaire where in there are 3 choices. obviously only 1 button carries the answer. all 3 buttons are sharing the same script for changing scene (scene 0). which is fine.
now i need to detect if the user used the Correct button for the answer, (let's say A is the correct button). it should still change the screen back to 0 and add the corresponding points to the Score Counter.
how do i use an if statement to check which among the 3 buttons is pressed for the correct answer so that Scorecount++; ... What i have in mind is a separate Script to detect if the Selection is correct or not but i'm not sure how to start.
Thanks all.
Right now i'm trying to reference each button, but i'm not sure how to put the Onclick even as a conditional statement to check if buttonA (correct answer) was selected.
public Button buttonA;
public Button buttonB;
public Button buttonC;
void checkAnswer()
{
buttonA = GameObject.Find("btnA").GetComponent<Button>();
buttonB = GameObject.Find("btnB").GetComponent<Button>();
buttonC = GameObject.Find("btnC").GetComponent<Button>();
}