Hi,
To start a conversation from C# code, use
DialogueManager.StartConversation().
(More info:
Commonly Used API Calls)
To delay the start, SetDialoguePanel() should work. If you're not using continue buttons, this will do:
Code: Select all
SetDialoguePanel(false, immediate);
SetDialoguePanel(true)@9
No need for the Delay(9) since the sequence will wait until the 9-second mark anyway for SetDialoguePanel(true).
If you're using continue buttons, change it to this:
Code: Select all
SetDialoguePanel(false, immediate);
required SetDialoguePanel(true)@9;
Continue()@9
The Continue()@9 simulates a continue button click at the 9-second mark. The 'required' keyword in front of SetDialoguePanel(true) guarantees that the command runs even if the Continue() happens to run first at the 9-second mark.
Here's an example scene:
DS_DelayedStartExample_2022-02-16.unitypackage
(The example waits 3 seconds.)
If the same thing doesn't work in your scene, it's possible that there's an issue with the main panel's Animator configuration.
Another way to hide and show the dialogue UI without impacting the Animator is to:
1. Give the Dialogue Manager's Canvas (or whatever canvas you're using for the dialogue UI) a unique name such as "DialogueCanvas".
2. Use the SetEnabled() sequencer command to disable and enable the canvas:
Code: Select all
SetEnabled(Canvas, false, DialogueCanvas);
required SetEnabled(Canvas, true, DialogueCanvas))@9;
Continue()@9
If you're starting the conversation when the scene starts, another way to delay the conversation is to use a Timed Event component instead of making the first node hide and delay with SetDialoguePanel:
- timedEventDelayedStart.png (41.86 KiB) Viewed 384 times