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

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. More...
 
void TakeCameraControl ()
 Takes control of the camera. More...
 
void Open ()
 Opens this instance. More...
 
void Close ()
 Closes and destroy this sequencer. More...
 
void OnDestroy ()
 
void Update ()
 
void SetParticipants (Transform speaker, Transform listener)
 
void PlaySequence (string sequence)
 Parses a sequence string and plays the individual commands. More...
 
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. More...
 
void PlayCommand (QueuedSequencerCommand commandRecord)
 
void PlayCommand (QueuedSequencerCommand commandRecord, string commandName, bool required, float time, string message, string endMessage, params string[] args)
 
void OnSequencerMessage (string message)
 
void Stop ()
 Stops all scheduled and active commands. More...
 
void StopQueued ()
 
void StopActive ()
 

Static Public Member Functions

static void Message (string message)
 Sends OnSequencerMessage(message) to the Dialogue Manager. More...
 
static void RegisterShortcut (string shortcut, string value)
 Registers a sequencer shortcut with the Dialogue System. More...
 
static void UnregisterShortcut (string shortcut)
 Unregisters a shortcut from the Dialogue System. More...
 
static string ReplaceShortcuts (string sequence)
 

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. More...
 
bool useOldParser = false
 Set true to use the old Dialogue System parser instead of the new, improved parser. More...
 

Properties

bool IsPlaying [get]
 Indicates whether a sequence is currently playing. More...
 
GameObject CameraAngles [get]
 
Camera SequencerCamera [get]
 
Transform? SequencerCameraTransform [get]
 
Transform Speaker [get]
 
Transform Listener [get]
 
Vector3 OriginalCameraPosition [get]
 
Quaternion OriginalCameraRotation [get]
 
float OriginalOrthographicSize [get]
 
float SubtitleEndTime [get, set]
 The subtitle end time ({{end}}) if playing a dialogue entry sequence. More...
 
string entrytag [get, set]
 The entrytag for the current dialogue entry, if playing a dialogue entry sequence. More...
 
string? entrytaglocal [get]
 

Events

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

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 ( )

Closes and destroy this sequencer.

Stops all actions and restores the original camera position.

◆ Message()

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

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 a sequencer. You can use this method if your sequence is waiting for a message.

Parameters
messageMessage to send.

◆ OnDestroy()

void PixelCrushers.DialogueSystem.Sequencer.OnDestroy ( )

◆ OnSequencerMessage()

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

◆ Open()

void PixelCrushers.DialogueSystem.Sequencer.Open ( )

Opens this instance.

Simply resets hasCameraControl.

◆ PlayCommand() [1/3]

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

◆ PlayCommand() [2/3]

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

◆ PlayCommand() [3/3]

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

Schedules a command to be played.

Parameters
commandNameThe command to play. See Sequencer Command Reference 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)

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 
)

◆ PlaySequence() [3/4]

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

◆ PlaySequence() [4/4]

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

◆ PlaySequenceAfterOneFrame()

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

◆ RegisterShortcut()

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

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)
static

◆ SetParticipants()

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

◆ Stop()

void PixelCrushers.DialogueSystem.Sequencer.Stop ( )

Stops all scheduled and active commands.

◆ StopActive()

void PixelCrushers.DialogueSystem.Sequencer.StopActive ( )

◆ StopQueued()

void PixelCrushers.DialogueSystem.Sequencer.StopQueued ( )

◆ SwitchCamera()

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

Switches the sequencer camera to a different camera object immediately.

Restores the previous camera first.

Parameters
newCameraNew camera.

◆ TakeCameraControl()

void PixelCrushers.DialogueSystem.Sequencer.TakeCameraControl ( )

Takes control of the camera.

◆ UnregisterShortcut()

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

Unregisters a shortcut from the Dialogue System.

Parameters
shortcutShortcut to remove.

◆ Update()

void PixelCrushers.DialogueSystem.Sequencer.Update ( )

◆ UseCamera() [1/2]

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

◆ UseCamera() [2/2]

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

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.

◆ useOldParser

bool PixelCrushers.DialogueSystem.Sequencer.useOldParser = false

Set true to use the old Dialogue System parser instead of the new, improved parser.

Property Documentation

◆ CameraAngles

GameObject PixelCrushers.DialogueSystem.Sequencer.CameraAngles
get

◆ 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

◆ 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.

◆ Listener

Transform PixelCrushers.DialogueSystem.Sequencer.Listener
get

◆ OriginalCameraPosition

Vector3 PixelCrushers.DialogueSystem.Sequencer.OriginalCameraPosition
get

◆ OriginalCameraRotation

Quaternion PixelCrushers.DialogueSystem.Sequencer.OriginalCameraRotation
get

◆ OriginalOrthographicSize

float PixelCrushers.DialogueSystem.Sequencer.OriginalOrthographicSize
get

◆ SequencerCamera

Camera PixelCrushers.DialogueSystem.Sequencer.SequencerCamera
get

◆ SequencerCameraTransform

Transform? PixelCrushers.DialogueSystem.Sequencer.SequencerCameraTransform
get

◆ 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.


The documentation for this class was generated from the following file:
PixelCrushers.DialogueSystem.Sequencer.Message
static void Message(string message)
Sends OnSequencerMessage(message) to the Dialogue Manager.
Definition: Sequencer.cs:179