Beispiel #1
0
    private IEnumerator StepThroughDialogue(DialoeObject dialoeObject)
    {
        for (int i = 0; i < dialoeObject.DialogueArray.Length; i++)
        {
            string dialogueContent = dialoeObject.DialogueArray[i];
            yield return(RunPrinting(dialogueContent));

            //yield return printing.RunCoroutine(dialogueContent, tmp_text);

            tmp_text.text = dialogueContent;

            if (i == dialoeObject.DialogueArray.Length - 1 && dialoeObject.HasResponses)
            {
                break;
            }

            yield return(null);

            yield return(new WaitUntil(() => Input.GetKeyDown(KeyCode.Return)));
        }

        if (dialoeObject.HasResponses)
        {
            responseHandler.showResponses(dialoeObject.ResponseArray);
        }
        else
        {
            CloseDialogue();
        }
    }
Beispiel #2
0
 public void ShowDialogue(DialoeObject dialoeObject)
 {
     dialogue_box.SetActive(true);
     dialogueIsOpen = true;
     StartCoroutine(StepThroughDialogue(dialoeObject));
 }