If(DialogManager.conversationComplete && DialogManager.GetCurrentPath().leadsToGameOver) { //DO GAME OVER STUFF. } Step 5 – Hit the new line button and make a new line.
Select a character from the dropdown box, if you followed the character tutorial you should notice your new character in the list. The text field next to the character selected is what they will say on that line. So fill it out with something simple like “Hello”. Add voice to the voice field if you have a voice file.
Step 6 – Add a few more lines to this path.
Step 7 – Create a new path and add some lines to it as you wish.
16
Step 8 – Now go back to your first path and press ‘Add Question to Path’. The question will automatically inherit the last line for the question that is asked and will generate at least one default response. Add one more response by clicking ‘Add Response’ once so your question looks something like mine…
Go ahead and fill out the text values to the responses while you are in there.
17
Step 9 – Pick where you want to make the path go to, you can go to ANY OTHER path in any scene.
I’m going to make my first response lead to Path 2, and my second response loop back round to the first path.
Step 10 – Press the save button at the top of the window and save into XMLScripts>User>name.xml Step 11- Close the window. Select the GUICamera, in the inspector (Dialog Manager) select the XML Script foldout and assign your newly created XML file to the field. Step 12 –Hit play and watch your script work! Remember to save!
18
TUTORIAL – CREATING A CUSTOM DIALOG BOX
So you want to change the look and feel of the conversation, follow this tutorial to see how. I’m not going to go into specifics on how to change fonts etc. There is plenty out there on Unity for that.
Step 1 – Open the scene you saved from the previous tutorial. Or open ‘SampleCutscene’ from the Samples. Step 2 – Drag in ‘DefaultDialog’ to the Hierarchy, this is obtained from Prefabs>Dialogs.
Step 3- Change the textures as you wish by dragging them onto each element in the Dialog box. You can also reposition elements as you see fit. See before and after.
19
Step 4 – Take a look in the inspector, you can assign different values to the various settings to meet your needs as you see fit.
Step 5 – You will also need to change the appearance of the save/load/answer prefabs and assign them as needed.
20