Beispiel #1
0
        private void CreateButtonForAnswer(IAnswer <string> answer)
        {
            var btnInstance = Instantiate(_answerButtonPrefab, _answersRoot);

            btnInstance.gameObject.SetActive(true);
            var btnText = btnInstance.GetComponentInChildren <TextMeshProUGUI>();

            if (btnText != null)
            {
                btnText.text = answer.GetAnswerData();
            }

            btnInstance.onClick.AddListener(() =>
            {
                _currentQuestion.CheckAnswer(answer);
            });

            _currentButtons.Add(btnInstance);
        }
 public bool IsEqualsTo(IAnswer <string> anotherAnswer)
 {
     return(anotherAnswer.GetAnswerData().Equals(_data));
 }