34 lines
661 B
C#
34 lines
661 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
namespace PahlawanEnergi.Quiz
|
|
{
|
|
public class ButtonChoice : MonoBehaviour
|
|
{
|
|
private QuizScreen quizScreen;
|
|
private QuizOption option;
|
|
|
|
[SerializeField] private TextMeshProUGUI choiceText;
|
|
|
|
public void Setup(QuizScreen quizScreen, QuizOption quizOption)
|
|
{
|
|
this.quizScreen = quizScreen;
|
|
this.option = quizOption;
|
|
|
|
choiceText.text = quizOption.optionValue;
|
|
|
|
}
|
|
|
|
public void Interact()
|
|
{
|
|
quizScreen.Answer(option.isCorrectAnswer);
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|