33 lines
785 B
C#
33 lines
785 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class A14LAnswerButton : MonoBehaviour
|
|
{
|
|
private Button thisBtn;
|
|
private Text thisTxt;
|
|
private A14LAnswerClass thisAnswer;
|
|
|
|
public void SetupThis(A14LAnswerClass receivedAnswer)
|
|
{
|
|
thisAnswer = receivedAnswer;
|
|
thisTxt = GetComponentInChildren<Text>();
|
|
thisBtn = GetComponent<Button>();
|
|
thisTxt.text = receivedAnswer.answerString;
|
|
thisBtn.onClick.AddListener(ResolveClick);
|
|
}
|
|
|
|
public void ResolveClick()
|
|
{
|
|
if (thisAnswer.isCorrect)
|
|
{
|
|
A14LQuestionManager.instance.Correct();
|
|
}
|
|
else
|
|
{
|
|
A14LQuestionManager.instance.Wrong();
|
|
}
|
|
}
|
|
}
|