To manually start a Dialogue is as easy as calling the Run
method from the Dialogue component. Bear in mind though that this method is a coroutine.
More information about coroutines here.
StartCoroutine(this.dialogue.Run());
The previous example shows how to start a conversation between characters. We provide a coroutine so that you can keep track when the conversation finishes. For example:
public IEnumerator StartDialogue(){Debug.Log("Start Dialogue!");yield return this.dialogue.Run();Debug.Log("Dialogue finished!");}
Thanks to the power of coroutines, we can hold the execution of the StartDialogue
method and resume it once the Dialogue is finished.