/// <summary> /// Loads the next node (if the current node allows it) and prepares it (calls process). /// </summary> public void processNextNode() { if (currentDialog.isNextNodeAvailable) { currentDialog = currentDialog.nextNode; if (currentDialog != null) { currentDialog.process(dialogContext); } else { // Deactivate all of the dialog's UI elements and unlock the player controls. PlayerController.instance.isMovementLocked = false; dialogContext.dialogTextField.text = dialogContext.whoTextField.text = ""; foreach (var butt in dialogContext.choiceButtons) { butt.enabled = false; } } } }
/// <summary> /// Show the dialog tree. /// </summary> /// <param name="treeName">Dialog tree to show.</param> public void showDialog(string treeName) { currentDialog = registeredDialogs["Dialogs/Trees/" + treeName]; currentDialog.process(dialogContext); PlayerController.instance.isMovementLocked = true; }