Dialogue runtime setup
Last updated
Last updated
Follow these steps for the runtime scene setup.
Create an empty GameObject in your scene and call it DialogueController.
Add the DialogueController component to it.
On the DialogueController, assign the DataLibrary in which your dialogue has been created.
Select the dialogue graph from the dropdown.
Now you'll need to assign a dialogue theme. You can find three ready to use themes in the folder: Dialogue / Themes Drag a theme prefab inside of a Canvas GameObject in the scene, then assign it to the DialogueController component.
Set a language - if you have defined some in your dialogue graph.
If you have any audio clips in your dialogue you'll have to assign the audio sources in the audiosources list. You can read more about the audio setup here ->
All relevant API methods are inside of the DialogueController component. If you want to start a dialogue simply call:
Here's a simple script which will start a dialogue on press of an IMGUI button:
By calling the StartDialogue method, the assigned dialogue theme which has the IDialogueUIControl interface implemented will receive a call on the OnDialogueStart method.