Send a Sequencer Message only after all Commands have run

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
LostTrainDude
Posts: 61
Joined: Wed Mar 21, 2018 2:14 pm

Send a Sequencer Message only after all Commands have run

Post by LostTrainDude »

[Unity 2019.4.36f1 - DS 2.2.25.1]

Hi Tony,

I know that by default, Commands in Sequences are not sequential, but I was wondering if there was a way to send a message that waited for *all* the commands in the Sequence to have run before getting broadcasted.

Because of course doing something like this:

Code: Select all

SetActive(GameObjectA, true); SetActive(GameObjectB, true)->Message(next);
only sends a message when the second Command has run, regardless of when it has happened.

As always, thanks in advance!
Chris
User avatar
Tony Li
Posts: 21055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Send a Sequencer Message only after all Commands have run

Post by Tony Li »

Hi Chris,

In the upcoming version 2.2.26, WaitForMessage() can wait for multiple messages. This patch contains the change:

DS_WaitForMessagePatch_2022-03-22.unitypackage

Example:

Code: Select all

SetActive(GameObjectA, true)->Message(ActivatedA);
SetActive(GameObjectB, true)->Message(ActivatedB);
WaitForMessage(ActivatedA, ActivatedB)->Message(ActivateC);
SetActive(GameObjectC, true)@Message(ActivateC)
LostTrainDude
Posts: 61
Joined: Wed Mar 21, 2018 2:14 pm

Re: Send a Sequencer Message only after all Commands have run

Post by LostTrainDude »

Oh, wow! It was in the air already :)

Thanks a lot!
User avatar
Tony Li
Posts: 21055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Send a Sequencer Message only after all Commands have run

Post by Tony Li »

Glad to help!
Post Reply