PixelCrushers.DialogueSystem.Sequencer Class Reference

A sequencer plays sequences of commands such as camera cuts, animation, audio, activating game objects, etc. More...

Inheritance diagram for PixelCrushers.DialogueSystem.Sequencer:
Collaboration diagram for PixelCrushers.DialogueSystem.Sequencer:

Public Member Functions

delegate void MessageStringDelegate (string message)
 
void UseCamera (Camera sequencerCamera, GameObject cameraAngles)
 
void UseCamera (Camera sequencerCamera, GameObject alternateSequencerCameraObject, GameObject cameraAngles)
 
void SwitchCamera (Camera newCamera)
 Switches the sequencer camera to a different camera object immediately.
 
void TakeCameraControl ()
 Takes control of the camera.
 
void Open ()
 Opens this instance.
 
void Close ()
 Closes and destroy this sequencer.
 
void OnDestroy ()
 
void Update ()
 
void SetParticipants (Transform speaker, Transform listener)
 
void PlaySequence (string sequence)
 Parses a sequence string and plays the individual commands.
 
void PlaySequence (string sequence, bool informParticipants, bool destroyWhenDone)
 
void PlaySequence (string sequence, Transform speaker, Transform listener, bool informParticipants, bool destroyWhenDone)
 
void PlaySequence (string sequence, Transform speaker, Transform listener, bool informParticipants, bool destroyWhenDone, bool delayOneFrame)
 
IEnumerator PlaySequenceAfterOneFrame (string sequence, Transform speaker, Transform listener, bool informParticipants, bool destroyWhenDone)
 
void PlayCommand (string commandName, bool required, float time, string message, string endMessage, params string[] args)
 Schedules a command to be played.
 
void PlayCommand (QueuedSequencerCommand commandRecord)
 
void PlayCommand (QueuedSequencerCommand commandRecord, string commandName, bool required, float time, string message, string endMessage, params string[] args)
 
System.Type GetTypeFromName (string typeName)
 
void OnSequencerMessage (string message)
 
void Stop ()
 Stops all scheduled and active commands.
 
void StopQueued ()
 
void StopActive ()
 
void SetDialoguePanel (bool show, bool immediate)
 

Static Public Member Functions

static void Message (string message)
 Sends OnSequencerMessage(message) to the Dialogue Manager.
 
static void RegisterShortcut (string shortcut, string value)
 Registers a sequencer shortcut with the Dialogue System.
 
static void UnregisterShortcut (string shortcut)
 Unregisters a shortcut from the Dialogue System.
 
static string ReplaceShortcuts (string sequence)
 
static void Preload ()
 
static void SetContinueMode (bool value)
 
static void SetContinueMode (DisplaySettings.SubtitleSettings.ContinueButtonMode mode)
 
static void SetOriginalContinueMode ()
 

Public Attributes

bool disableInternalSequencerCommands = false
 Set true to disable the internal sequencer commands – for example, if you want to replace them all with your own.
 

Static Public Attributes

static bool reportMissingAudioFiles = false
 
static Sequencer s_awakeSequencer
 SequencerCommand can refer to these if they run in Awake.
 
static string s_awakeEndMessage
 
static Transform s_awakeSpeaker
 
static Transform s_awakeListener
 
static string[] s_awakeArgs
 

Properties

bool isPlaying [get]
 Indicates whether a sequence is currently playing.
 
GameObject cameraAngles [get]
 
Camera sequencerCamera [get]
 
Transform sequencerCameraTransform [get]
 
Transform speaker [get]
 
Transform listener [get]
 
ConversationView conversationView [get, set]
 
Vector3 originalCameraPosition [get, set]
 Original camera position at start of conversation.
 
Quaternion originalCameraRotation [get, set]
 Original camera position at start of conversation.
 
float originalOrthographicSize [get, set]
 Original 2D camera orthographic size at start of conversation.
 
bool keepCameraPositionOnClose [get, set]
 If true, don't restore camera position to pre-sequence position when sequencer closes.
 
float subtitleEndTime [get, set]
 The subtitle end time ({{end}}) if playing a dialogue entry sequence.
 
string entrytag [get, set]
 The entrytag for the current dialogue entry, if playing a dialogue entry sequence.
 
string entrytaglocal [get]
 Currently language-localized entrytag.
 
ActiveConversationRecord activeConversationRecord [get, set]
 Active conversation record associated with this sequencer instance.
 
int numQueuedCommands [get]
 
int numActiveCommands [get]
 
static Dictionary< string, string > shortcuts [get]
 Registered shortcuts:
 
static Dictionary< string, Stack< string > > shortcutStack [get]
 Stack of values for each shortcut.
 

Events

Action FinishedSequenceHandler = null
 This handler is called when the sequence is done playing.
 
MessageStringDelegate receivedMessage = null
 

Detailed Description

A sequencer plays sequences of commands such as camera cuts, animation, audio, activating game objects, etc.

You can use the sequencer to play cutscenes or perform game actions. The dialogue system uses a sequencer to play a sequence for every line of dialogue. If the dialogue author hasn't specified a sequence for a line of dialogue, the dialogue system will generate a basic, default sequence that aims the camera at the speaker.

See also: sequencer

Each sequence command is implemented as a coroutine. You can add new commands by defining subclasses of SequencerCommand.

Member Function Documentation

◆ Close()

void PixelCrushers.DialogueSystem.Sequencer.Close ( )
inline

Closes and destroy this sequencer.

Stops all actions and restores the original camera position.

◆ GetTypeFromName()

System.Type PixelCrushers.DialogueSystem.Sequencer.GetTypeFromName ( string  typeName)
inline

◆ Message()

static void PixelCrushers.DialogueSystem.Sequencer.Message ( string  message)
inlinestatic

Sends OnSequencerMessage(message) to the Dialogue Manager.

Since sequencers are usually on the Dialogue Manager object, this is a convenient way to send a message to all active sequencers. You can use this method if your sequence is waiting for a message.

Parameters
messageMessage to send.

◆ MessageStringDelegate()

delegate void PixelCrushers.DialogueSystem.Sequencer.MessageStringDelegate ( string  message)

◆ OnDestroy()

void PixelCrushers.DialogueSystem.Sequencer.OnDestroy ( )
inline

◆ OnSequencerMessage()

void PixelCrushers.DialogueSystem.Sequencer.OnSequencerMessage ( string  message)
inline

◆ Open()

void PixelCrushers.DialogueSystem.Sequencer.Open ( )
inline

Opens this instance.

Simply resets hasCameraControl.

◆ PlayCommand() [1/3]

void PixelCrushers.DialogueSystem.Sequencer.PlayCommand ( QueuedSequencerCommand  commandRecord)
inline

◆ PlayCommand() [2/3]

void PixelCrushers.DialogueSystem.Sequencer.PlayCommand ( QueuedSequencerCommand  commandRecord,
string  commandName,
bool  required,
float  time,
string  message,
string  endMessage,
params string[]  args 
)
inline

◆ PlayCommand() [3/3]

void PixelCrushers.DialogueSystem.Sequencer.PlayCommand ( string  commandName,
bool  required,
float  time,
string  message,
string  endMessage,
params string[]  args 
)
inline

Schedules a command to be played.

Parameters
commandNameThe command to play. See sequencerCommands for the list of valid commands.
requiredIf true, the command will play even if Stop() is called. If this command absolutely must run (for example, setting up the final camera angle at the end of the sequence), set required to true.
timeThe time delay in seconds at which to start the command. If time is 0, the command starts immediately.
argsAn array of arguments for the command. Pass null if no arguments are required.

// At the 2 second mark, cut the camera to a closeup of the listener. string[] args = new string[] { "Closeup", "listener" }; Play("Camera", true, 2, args);

◆ PlaySequence() [1/4]

void PixelCrushers.DialogueSystem.Sequencer.PlaySequence ( string  sequence)
inline

Parses a sequence string and plays the individual commands.

Parameters
sequenceThe sequence to play, in the form:
\<sequence\> ::= \<statement\> ; \<statement\> ; ...
\<statement\> ::= [required] \<command\>( \<arg\>, \<arg\>, ... ) [@\<time\>] [->Message(Y)]

For example, the sequence below shows a wide angle shot of the speaker reloading and firing, and then cuts to a closeup of the listener.

Camera(Wide); Animation(Reload); Animation(Fire)@2; required Camera(Closeup, listener)@3.5

◆ PlaySequence() [2/4]

void PixelCrushers.DialogueSystem.Sequencer.PlaySequence ( string  sequence,
bool  informParticipants,
bool  destroyWhenDone 
)
inline

◆ PlaySequence() [3/4]

void PixelCrushers.DialogueSystem.Sequencer.PlaySequence ( string  sequence,
Transform  speaker,
Transform  listener,
bool  informParticipants,
bool  destroyWhenDone 
)
inline

◆ PlaySequence() [4/4]

void PixelCrushers.DialogueSystem.Sequencer.PlaySequence ( string  sequence,
Transform  speaker,
Transform  listener,
bool  informParticipants,
bool  destroyWhenDone,
bool  delayOneFrame 
)
inline

◆ PlaySequenceAfterOneFrame()

IEnumerator PixelCrushers.DialogueSystem.Sequencer.PlaySequenceAfterOneFrame ( string  sequence,
Transform  speaker,
Transform  listener,
bool  informParticipants,
bool  destroyWhenDone 
)
inline

◆ Preload()

static void PixelCrushers.DialogueSystem.Sequencer.Preload ( )
inlinestatic

◆ RegisterShortcut()

static void PixelCrushers.DialogueSystem.Sequencer.RegisterShortcut ( string  shortcut,
string  value 
)
inlinestatic

Registers a sequencer shortcut with the Dialogue System.

When playing sequences, shortcuts wrapped in double braces are replaced by their values.

Parameters
shortcutShortcut ID
valueSequence that replaces the shortcut ID.

◆ ReplaceShortcuts()

static string PixelCrushers.DialogueSystem.Sequencer.ReplaceShortcuts ( string  sequence)
inlinestatic

◆ SetContinueMode() [1/2]

static void PixelCrushers.DialogueSystem.Sequencer.SetContinueMode ( bool  value)
inlinestatic

◆ SetContinueMode() [2/2]

static void PixelCrushers.DialogueSystem.Sequencer.SetContinueMode ( DisplaySettings::SubtitleSettings::ContinueButtonMode  mode)
inlinestatic

◆ SetDialoguePanel()

void PixelCrushers.DialogueSystem.Sequencer.SetDialoguePanel ( bool  show,
bool  immediate 
)
inline

◆ SetOriginalContinueMode()

static void PixelCrushers.DialogueSystem.Sequencer.SetOriginalContinueMode ( )
inlinestatic

◆ SetParticipants()

void PixelCrushers.DialogueSystem.Sequencer.SetParticipants ( Transform  speaker,
Transform  listener 
)
inline

◆ Stop()

void PixelCrushers.DialogueSystem.Sequencer.Stop ( )
inline

Stops all scheduled and active commands.

◆ StopActive()

void PixelCrushers.DialogueSystem.Sequencer.StopActive ( )
inline

◆ StopQueued()

void PixelCrushers.DialogueSystem.Sequencer.StopQueued ( )
inline

◆ SwitchCamera()

void PixelCrushers.DialogueSystem.Sequencer.SwitchCamera ( Camera  newCamera)
inline

Switches the sequencer camera to a different camera object immediately.

Restores the previous camera first.

Parameters
newCameraNew camera.

◆ TakeCameraControl()

void PixelCrushers.DialogueSystem.Sequencer.TakeCameraControl ( )
inline

Takes control of the camera.

◆ UnregisterShortcut()

static void PixelCrushers.DialogueSystem.Sequencer.UnregisterShortcut ( string  shortcut)
inlinestatic

Unregisters a shortcut from the Dialogue System.

Parameters
shortcutShortcut to remove.

◆ Update()

void PixelCrushers.DialogueSystem.Sequencer.Update ( )
inline

◆ UseCamera() [1/2]

void PixelCrushers.DialogueSystem.Sequencer.UseCamera ( Camera  sequencerCamera,
GameObject  alternateSequencerCameraObject,
GameObject  cameraAngles 
)
inline

◆ UseCamera() [2/2]

void PixelCrushers.DialogueSystem.Sequencer.UseCamera ( Camera  sequencerCamera,
GameObject  cameraAngles 
)
inline

Member Data Documentation

◆ disableInternalSequencerCommands

bool PixelCrushers.DialogueSystem.Sequencer.disableInternalSequencerCommands = false

Set true to disable the internal sequencer commands – for example, if you want to replace them all with your own.

◆ reportMissingAudioFiles

bool PixelCrushers.DialogueSystem.Sequencer.reportMissingAudioFiles = false
static

◆ s_awakeArgs

string [] PixelCrushers.DialogueSystem.Sequencer.s_awakeArgs
static

◆ s_awakeEndMessage

string PixelCrushers.DialogueSystem.Sequencer.s_awakeEndMessage
static

◆ s_awakeListener

Transform PixelCrushers.DialogueSystem.Sequencer.s_awakeListener
static

◆ s_awakeSequencer

Sequencer PixelCrushers.DialogueSystem.Sequencer.s_awakeSequencer
static

SequencerCommand can refer to these if they run in Awake.

◆ s_awakeSpeaker

Transform PixelCrushers.DialogueSystem.Sequencer.s_awakeSpeaker
static

Property Documentation

◆ activeConversationRecord

ActiveConversationRecord PixelCrushers.DialogueSystem.Sequencer.activeConversationRecord
getset

Active conversation record associated with this sequencer instance.

◆ cameraAngles

GameObject PixelCrushers.DialogueSystem.Sequencer.cameraAngles
get

◆ conversationView

ConversationView PixelCrushers.DialogueSystem.Sequencer.conversationView
getset

◆ entrytag

string PixelCrushers.DialogueSystem.Sequencer.entrytag
getset

The entrytag for the current dialogue entry, if playing a dialogue entry sequence.

◆ entrytaglocal

string PixelCrushers.DialogueSystem.Sequencer.entrytaglocal
get

Currently language-localized entrytag.

◆ isPlaying

bool PixelCrushers.DialogueSystem.Sequencer.isPlaying
get

Indicates whether a sequence is currently playing.

The Dialogue System can queue up any number of actions using the Play() method. This property returns true if any actions are scheduled or active.

true if is playing; otherwise, false.

◆ keepCameraPositionOnClose

bool PixelCrushers.DialogueSystem.Sequencer.keepCameraPositionOnClose
getset

If true, don't restore camera position to pre-sequence position when sequencer closes.

◆ listener

Transform PixelCrushers.DialogueSystem.Sequencer.listener
get

◆ numActiveCommands

int PixelCrushers.DialogueSystem.Sequencer.numActiveCommands
get

◆ numQueuedCommands

int PixelCrushers.DialogueSystem.Sequencer.numQueuedCommands
get

◆ originalCameraPosition

Vector3 PixelCrushers.DialogueSystem.Sequencer.originalCameraPosition
getset

Original camera position at start of conversation.

At the end of the conversation, the camera is restored back to this position. You can change this if you want to reset the 'original' position to be elsewhere.

◆ originalCameraRotation

Quaternion PixelCrushers.DialogueSystem.Sequencer.originalCameraRotation
getset

Original camera position at start of conversation.

You can change this if you want to reset the 'original' rotation to be different.

◆ originalOrthographicSize

float PixelCrushers.DialogueSystem.Sequencer.originalOrthographicSize
getset

Original 2D camera orthographic size at start of conversation.

You can change this if you want to reset the the 'original' size to be different.

◆ sequencerCamera

Camera PixelCrushers.DialogueSystem.Sequencer.sequencerCamera
get

◆ sequencerCameraTransform

Transform PixelCrushers.DialogueSystem.Sequencer.sequencerCameraTransform
get

◆ shortcuts

Dictionary<string, string> PixelCrushers.DialogueSystem.Sequencer.shortcuts
staticget

Registered shortcuts:

◆ shortcutStack

Dictionary<string, Stack<string> > PixelCrushers.DialogueSystem.Sequencer.shortcutStack
staticget

Stack of values for each shortcut.

If adding a shortcut that already exists, the new value of the shortcut is added to the top of the stack. When removed, it's popped off the stack, revealing the previous value.

◆ speaker

Transform PixelCrushers.DialogueSystem.Sequencer.speaker
get

◆ subtitleEndTime

float PixelCrushers.DialogueSystem.Sequencer.subtitleEndTime
getset

The subtitle end time ({{end}}) if playing a dialogue entry sequence.

Event Documentation

◆ FinishedSequenceHandler

Action PixelCrushers.DialogueSystem.Sequencer.FinishedSequenceHandler = null

This handler is called when the sequence is done playing.

◆ receivedMessage

MessageStringDelegate PixelCrushers.DialogueSystem.Sequencer.receivedMessage = null

The documentation for this class was generated from the following file: