/// <summary>
    /// This method progresses the dialog to any given point with the <paramref name="tether"/> destination.
    /// </summary>
    /// <param name="tether">The <c>DialogTether</c> for the dialog to progress along.</param>
    public void Progress(DialogTether tether)
    {
        if (tether == null)
        {
            Debug.LogError("Tether on Progress method is null. This is an unexpected state and will terminate the Dialog to protect any additional scripts.");
            TerminateDialog();
            return;
        }

        onProgress.Invoke(tether);

        if (_currentBasicDialog._shouldFireScriptEvents)
        {
            _currentBasicDialog._scriptEvents.Invoke();
            onDialogBoxScriptFire.Invoke();
        }

        if (tether._destination == null)
        {
            TerminateDialog();
            return;
        }

        SetDialogBox(tether._destination);
    }
    /// <summary>
    /// This method progresses the dialog with the assumption that there is only a single unseen branch to be chosen.
    /// </summary>
    public void BranchChosen()
    {
        DialogTether tether = _currentBasicDialog._nexts[0];

        if (tether != null && tether._destination == null)
        {
            onPathChosen.Invoke(tether);
            TerminateDialog();
            return;
        }

        onPathChosen.Invoke(tether);
        onDialogBoxEnd.Invoke();

        Progress(_currentBasicDialog._nexts[0]);
    }
    /// <summary>
    /// This method will progress the dialog along the <paramref name="pathIndex"/> branch.
    /// </summary>
    /// <param name="pathIndex">The index of the branch to follow.</param>
    public void BranchChosen(int pathIndex)
    {
        if (_currentBasicDialog._nexts.Length - 1 < pathIndex)
        {
            BranchChosen();
        }

        DialogTether tether = _currentBasicDialog._nexts[pathIndex];

        if (tether._destination == null)
        {
            onPathChosen.Invoke(null);
            TerminateDialog();
            return;
        }

        onPathChosen.Invoke(tether);
        onDialogBoxEnd.Invoke();

        Progress(_currentBasicDialog._nexts[pathIndex]);
    }
Exemplo n.º 4
0
 public void OnPathChosen(DialogTether tether)
 {
     Debug.Log("Path has been chosen.");
 }
Exemplo n.º 5
0
 public void OnProgress(DialogTether tether)
 {
     Debug.Log("Dialog Progressing.");
 }