Beispiel #1
0
        private void UpdateButtons(DialogueNode dialogueNode)
        {
            if (dialogueNode.IsHasAnswers())
            {
                _nextButton.gameObject.SetActive(false);

                var answerCount = dialogueNode.AnswerCount();
                for (int i = 0; i < answerCount; i++)
                {
                    var currentAnswerButton = _answerButtons[i];
                    currentAnswerButton.SetActive(true);
                    currentAnswerButton.SetText(dialogueNode.GetAnswerTextById(i));
                }
            }
            else
            {
                _nextButton.gameObject.SetActive(true);
                foreach (var answerButton in _answerButtons)
                {
                    answerButton.SetActive(false);
                }
            }
        }