Пример #1
0
        public void SetDialogNode(DialogNode dialogNode)
        {
            if (dialogNode.blockGameplay)
            {
                EventManager.TriggerEvent(EventNames.HIDE_HUD);
                Time.timeScale = 0f;
            }

            BlockGameplay = dialogNode.blockGameplay;
            dialogTextPanel.SetOpen(true);

            sentences.Clear();

            foreach (string sentence in dialogNode.dialogSentences)
            {
                sentences.Enqueue(sentence);
            }

            dialogTextPanel.SetSpeakerAvatar(dialogNode.speakerAvatar);
            dialogTextPanel.SetSpeakerName(dialogNode.speakerName);

            if (dialogNode.responses.Length > 1)
            {
                EventManager.TriggerEvent(EventNames.HIDE_HUD);
                Time.timeScale = 0f;
            }

            currentDialogNode = dialogNode;
            DisplayNextSentence();
        }
Пример #2
0
        public void SetData(DialogManagerData dialogManagerData)
        {
            Start();

            dialogResponsePanel.Start();
            dialogTextPanel.Start();

            BlockGameplay = dialogManagerData.blockGameplay;
            sentences     = dialogManagerData.sentences;

            if (dialogManagerData.currentDialogNode != null && dialogManagerData.currentDialogNode != "")
            {
                currentDialogNode = ResourceManager.GetDialogNode(dialogManagerData.currentDialogNode);

                if (sentences.Count != 0)
                {
                    dialogTextPanel.SetOpen(true);
                    DisplayNextSentence();
                }
            }
        }