Ejemplo n.º 1
0
    public IEnumerator ShowDialogue(Dialogue dialogue, Action onFinished = null)
    {
        yield return(new WaitForEndOfFrame());

        OnShowDialogue?.Invoke();

        IsShowing       = true;
        this.dialogue   = dialogue;
        this.onFinished = onFinished;
        dialogueBox.SetActive(true);
        StartCoroutine(TypeDialogue(dialogue.Lines[0]));
    }
Ejemplo n.º 2
0
    public IEnumerator ShowDialog(Dialogue dialogue)
    {
        //wait for one frame allows the handleupdate to happen stopping the !isTyping issues
        yield return(new WaitForEndOfFrame());

        OnShowDialogue.Invoke();

        this.dialogue = dialogue;
        dialogueBox.SetActive(true);
        //show the first line of dialogue
        StartCoroutine(TypeDialog(dialogue.Lines[0]));
    }