예제 #1
0
    public void HandleUpdate()
    {
        if (Input.anyKeyDown && !isTyping)
        {
            ++currentLine;
            if (currentLine < dialogue.Lines.Count)
            {
                StartCoroutine(TypeDialogue(dialogue.Lines[currentLine]));
            }
            else
            {
                currentLine = 0;
                IsShowing   = false;
                dialogueBox.SetActive(false);

                onFinished?.Invoke();
                OnCloseDialogue?.Invoke();
            }
        }
    }
예제 #2
0
 public void HandleUpdate()
 {
     //&& is to stop the text being overweritten and adding together when typing
     if (Input.GetKeyDown(KeyCode.Z) && !isTyping)
     {
         ++currentLine;
         if (currentLine < dialogue.Lines.Count)
         {
             StartCoroutine(TypeDialog(dialogue.Lines[currentLine]));
         }
         else
         {
             //reset lines so next dialogue it starts at 0
             currentLine = 0;
             dialogueBox.SetActive(false);
             //invoke the on close dialogue state control
             OnCloseDialogue?.Invoke();
         }
     }
 }