Ejemplo n.º 1
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            structure = (SO_QuestionAnswerStructure)target;

            // draw separation line from rest of editor
            GUILayout.Space(40);
            GUILayout.Label("Debug view");

            // Draw question
            DrawQuestion(previewLanguage);

            GUILayout.Space(5);

            // Draw Answers
            DrawAnswers(previewLanguage);
        }
Ejemplo n.º 2
0
        public void Initialize(SO_DialogStructure _inputData, DialogueManager _manager, Language _targetlanguage)
        {
            dialogueManager = _manager;
            dialogueData    = _inputData as SO_QuestionAnswerStructure;

            question.text      = dialogueData.GetQuestion(_targetlanguage);
            spekerImage.sprite = _inputData.GetSpeakerSprite();

            foreach (SO_Answer answer in dialogueData.GetAnswers())
            {
                CanvasedAnswer canvasedAnswer = Instantiate(answerPrefab, answersContainer);
                canvasedAnswer.Initialize(answer, dialogueManager, _targetlanguage);

                if (canvasedAnswers == null)
                {
                    canvasedAnswers = new List <CanvasedAnswer>();
                }

                canvasedAnswers.Add(canvasedAnswer);
            }

            EnableVisibility();
        }