Ejemplo n.º 1
0
 /// <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;
             }
         }
     }
 }
Ejemplo n.º 2
0
 /// <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;
 }