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); }
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(); }