// If there is a message in the queue private IEnumerator NextMessage(bool beginning) { if (messagesQueue.Count != 0) { Message m = messagesQueue.Dequeue(); UIEvents.DisplayDialogue(m.message); yield return(new WaitForSeconds(m.displayTimeSeconds)); StartCoroutine(NextMessage(beginning)); } else { // End of Day if (beginning) { GameManager.Instance.DialogueEnded(); } else { GameManager.Instance.EndDay(); } } }