Hi,
Apologies if this has been explained elsewhere but I've done lots of searching here and haven't found an answer yet.
I'm working on a scene where I want to switch from a standard interactive dialogue UI to a simple narrator "subtitles only" UI and then back again, preferably inside the same conversation. Using different subtitle panels hasn't worked, because for the second UI I don't want any of the other components (background image, divider line, etc). So far I've been able to achieve this by ending the first conversation and immediately starting a new one, which has its own override UI, but this ends up quite complicated and I'm sure I'm going the wrong way about it. Quick examples of the 2 different UIs:
https://drive.google.com/file/d/1Um-ERu ... drive_link
https://drive.google.com/file/d/1EpXwFM ... drive_link
Is there any way of switching out the whole dialogue UI during a conversation? Or if not, is there another simpler way of switching to this "narrator mode" type of subtitles?
Thanks!
Change whole Dialogue UI during conversation
Re: Change whole Dialogue UI during conversation
Hi,
To switch UIs mid-conversation, assign the new UI to DialogueManager.conversationView.dialogueUI.
To switch UIs mid-conversation, assign the new UI to DialogueManager.conversationView.dialogueUI.
Re: Change whole Dialogue UI during conversation
Hi Tony,
Thanks for the quick response! I've had a look and I'm not sure exactly where I should be assigning this - do I need to edit the DialogueSystemController script to add a second UI prefab and write a function to be called from within a conversation?
Thanks for the quick response! I've had a look and I'm not sure exactly where I should be assigning this - do I need to edit the DialogueSystemController script to add a second UI prefab and write a function to be called from within a conversation?
Re: Change whole Dialogue UI during conversation
Hi,
No, you can set it in your own script. Just include that line in your script, such as:
No, you can set it in your own script. Just include that line in your script, such as:
Code: Select all
using PixelCrushers.DialogueSystem; // Include at top of script.
public StandardDialogueUI otherDialogueUI; // Assign in inspector (for example).
public void UseOtherDialogueUI() // Call this when you want to use the other UI.
{
DialogueManager.conversationView.dialogueUI = otherDialogueUI;
}
Re: Change whole Dialogue UI during conversation
Ah that makes sense, thank you. I have this set up now, but when I call the UseOtherDialogueUI function the UI just seems to go blank while the conversation continues (I've tried this with a few of the pre-made dialogue UIs to make sure it's not due to the way I've set up my UI).
I noticed that when I assign the new UI to this script, it links directly to the StandardDialogueUI script, whereas the Dialogue System Controller and Override Dialogue UI components link to the actual UI game object. Should the game object of the second dialogue UI be held somewhere else in the scene too, or added within my main dialogue UI somehow?
I noticed that when I assign the new UI to this script, it links directly to the StandardDialogueUI script, whereas the Dialogue System Controller and Override Dialogue UI components link to the actual UI game object. Should the game object of the second dialogue UI be held somewhere else in the scene too, or added within my main dialogue UI somehow?
Re: Change whole Dialogue UI during conversation
Hi,
otherDialogueUI should be a GameObject (with a StandardDialogueUI component) in your scene, not a prefab. If it's a prefab, that might be the issue.
otherDialogueUI should be a GameObject (with a StandardDialogueUI component) in your scene, not a prefab. If it's a prefab, that might be the issue.
Re: Change whole Dialogue UI during conversation
Great, yes this got it working - I added my new UI gameobject as a child of the canvas in the Dialogue Manager gameobject in my scene, and I can now easily switch between the two UIs during a conversation. Thanks Tony!
Re: Change whole Dialogue UI during conversation
Glad to help!