Esempio n. 1
0
        public static void PresentQuestion(IQuestion q)
        {
            q.Display();
            Console.WriteLine(("Your answer: "));
            string response = Console.ReadLine();

            Console.WriteLine((q.CheckAnswer(response)));
        }
Esempio n. 2
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);
        }