How to check if a sequence is playing

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
n_hagialas
Posts: 36
Joined: Wed May 03, 2017 4:34 pm

How to check if a sequence is playing

Post by n_hagialas »

Hi, how can I check if a sequence (we typically use them to write cutscenes) is currently playing?
We want to disable Menu's from being openable during them.

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

Re: How to check if a sequence is playing

Post by Tony Li »

Hi Nik,

Add a script to the Dialogue Manager that has OnSequenceStart(Transform) and OnSequenceEnd(Transform) special script methods. Example:

Code: Select all

private int numActiveSequences = 0;

public bool IsSequenceActive => (numActiveSequences > 0);

void OnSequenceStart(Transform actor) { numActiveSequences++; }

void OnSequenceEnd(Transform actor) { numActiveSequences--; }
Post Reply