Assigning Bark UI to DontDestroyOnLoad Dialogue Manager

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Assigning Bark UI to DontDestroyOnLoad Dialogue Manager

Post by pegassy »

I have customized the bark UI to work as a part of the screen space UI, and assigned this to work under the Dialogue System Canvas. So I assign that bark UI in the dialogue actor component. However, since the dialogue manager persists through scenes, the UI will not be recognized except the first level. Is there any solution for this?
User avatar
Tony Li
Posts: 20990
Joined: Thu Jul 18, 2013 1:27 pm

Re: Assigning Bark UI to DontDestroyOnLoad Dialogue Manager

Post by Tony Li »

Hi,

Here are two ideas:

1. Move the Dialogue Manager's Canvas out of the Dialogue Manager, and put a separate instance of the Canvas in each scene. Add a script to the dialogue UI that calls DialogueManager.UseDialogueUI():

Code: Select all

using UnityEngine;
public class UseMyDialogueUI : MonoBehaviour
{
    void Start() 
    {
        PixelCrushers.DialogueSystem.DialogueManager.UseDialogueUI(this.gameObject);
    }
}
2. Or put the character's bark UI in a separate screen space canvas that exists only in the scene with the character.
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Re: Assigning Bark UI to DontDestroyOnLoad Dialogue Manager

Post by pegassy »

Thank you for ideas. I tried the second one and seems to be working pretty good.
User avatar
Tony Li
Posts: 20990
Joined: Thu Jul 18, 2013 1:27 pm

Re: Assigning Bark UI to DontDestroyOnLoad Dialogue Manager

Post by Tony Li »

Great! That would have been my preference, too.
Post Reply