Example #1
0
    public IEnumerator ShowDialog(Dialog dialog)
    {
        yield return(new WaitForEndOfFrame());

        OnShowDialog?.Invoke();

        this.dialog = dialog;
        dialogBox.SetActive(true);
        StartCoroutine(TypeDialog(dialog.Lines[0]));
    }
Example #2
0
    public IEnumerator ShowDialog(Dialog dialog, Action OnFinished = null)
    {
        yield return(new WaitForEndOfFrame());

        OnShowDialog?.Invoke();
        IsShowing        = true;
        this.dialog      = dialog;
        OnDialogFinished = OnFinished;
        dialogbox.SetActive(true);
        StartCoroutine(TypeDialog(dialog.Lines[0]));
    }
Example #3
0
    // Method to print out the first line of dialog and to call the onShowDialog Event.
    public IEnumerator ShowDialog(Dialog dialog, Action onFinished = null)
    {
        yield return(new WaitForEndOfFrame());

        IsShowing = true;
        OnShowDialog?.Invoke();
        this.dialog      = dialog;
        onDialogFinished = onFinished;
        dialogBox.SetActive(true);
        StartCoroutine(TypeDialog(dialog.Lines[0]));
        Debug.Log("How many times");
    }
Example #4
0
    public IEnumerator ShowDialog(Dialog dialog, Action onFinished = null)
    {
        yield return(new WaitForEndOfFrame()); //This is to avoid issues with key pressed while interacting and not being in the dialog state

        OnShowDialog?.Invoke();                //Call the action to show dialog

        IsShowing        = true;
        this.dialog      = dialog;
        onDialogFinished = onFinished;

        dialogBox.SetActive(true);                   //First we active the dialogBox
        StartCoroutine(TypeDialog(dialog.Lines[0])); //This will show the first line of the dialog
    }