void ChangeText() { textObjectActions objectDequeued = textsToShow.Dequeue(); CancelInvoke("ChangeText"); if (textsToShow.Count <= 0) { canEnter = true; pController.canDoThings = true; dialogPanel.SetActive(false); if (objectDequeued.script != null && objectDequeued.endMethod != null) { objectDequeued.script.SendMessage(objectDequeued.endMethod); } } else { objectDequeued = textsToShow.Peek(); canEnter = !objectDequeued.isTuto; dialogText.text = objectDequeued.text; if (objectDequeued.script != null && objectDequeued.initMethod != null) { objectDequeued.script.SendMessage(objectDequeued.initMethod); } Invoke("ChangeText", timeBetweenDialogTexts); } }
void AddNewDialog(textObjectActions objectIn) { canEnter = !objectIn.isTuto; dialogPanel.SetActive(true); dialogText.text = objectIn.text; Invoke("ChangeText", timeBetweenDialogTexts); }
public void AddDialogText(string text, bool isTuto) { textObjectActions textObject = new textObjectActions(text, null, null, null, isTuto); textsToShow.Enqueue(textObject); if (!dialogPanel.activeSelf) { AddNewDialog(textObject); } }
public void AddDialogText(string text, MonoBehaviour script, string initMethod, string endMethod, bool isTuto) { textObjectActions textObject = new textObjectActions(text, script, initMethod, endMethod, isTuto); textsToShow.Enqueue(textObject); if (!dialogPanel.activeSelf) { if (script != null && initMethod != null) { script.SendMessage(initMethod); } AddNewDialog(textObject); } }