1 using System.Collections;
2 using System.Collections.Generic;
5 public class DialogueManager : MonoBehaviour
7 private Queue<string> sentences;
9 // Start is called before the first frame update
12 sentences = new Queue<string>();
15 public void StartDialogue (Dialogue dialogue)
19 foreach (string sentence in dialogue.sentences)
21 sentences.Enqueue(sentence);
24 DisplayNextSentence();
27 public void DisplayNextSentence()
29 if(sentences.Count == 0)
35 string sentence = sentences.Dequeue();
41 Debug.Log("End of conversation");