public void OnAnswerClicked(int choice) { selected = choice; Answer1.GetComponentInChildren <Image>().color = Color.white; Answer2.GetComponentInChildren <Image>().color = Color.white; Answer3.GetComponentInChildren <Image>().color = Color.white; Answer4.GetComponentInChildren <Image>().color = Color.white; if (selected > 0 && confidenceVal > 0) { NextButton.GetComponent <Button>().interactable = true; } switch (choice) { case 1: Answer1.GetComponentInChildren <Image>().color = Color.yellow; break; case 2: Answer2.GetComponentInChildren <Image>().color = Color.yellow; break; case 3: Answer3.GetComponentInChildren <Image>().color = Color.yellow; break; case 4: Answer4.GetComponentInChildren <Image>().color = Color.yellow; break; } LogHelper.AnswerChanged(true_question_id); }