Dialogue override using the sequence

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
mudukke
Posts: 73
Joined: Wed Sep 27, 2023 4:15 am

Dialogue override using the sequence

Post by mudukke »

Out of interest can do a dialogue override on the sequence. I have opening sequence that starts with main dialogue UI but I would like to use the dialogue override ui. How would switch between the dialogue override and the main dialogue using the sequence if that's possible?
User avatar
Tony Li
Posts: 22106
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue override using the sequence

Post by Tony Li »

Hi,

In C#, you can use:

Code: Select all

DialogueManager.conversationView.dialogueUI = some_Other_Dialogue_UI;
You could write a sequencer command that runs that code. Maybe something like:

Code: Select all

public class SequencerCommandSetDialogueUI : SequencerCommand
{
    void Awake()
    {
        var uiGO = GetSubject(0);
        if (uiGO == null)
        {
            Debug.LogWarning($"SetDialogueUI() can't find GameObject named {GetParameter(0)}");
        }
        else
        {
            var ui = uiGO.GetComponent<IDialogueUI>();
            if (ui == null)
            {
                Debug.LogWarning($"SetDialogueUI() can't find a UI on {uiGO}");
            }
            else
            {
                DialogueManager.conversationView.dialogueUI = ui;
            }
        }
        Stop();
    }
}
Post Reply