A sequencer plays sequences of commands such as camera cuts, animation, audio, activating game objects, etc. More...
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... | |
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.
void PixelCrushers.DialogueSystem.Sequencer.Close | ( | ) |
Closes and destroy this sequencer.
Stops all actions and restores the original camera position.
|
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.
message | Message to send. |
void PixelCrushers.DialogueSystem.Sequencer.OnDestroy | ( | ) |
void PixelCrushers.DialogueSystem.Sequencer.OnSequencerMessage | ( | string | message | ) |
void PixelCrushers.DialogueSystem.Sequencer.Open | ( | ) |
Opens this instance.
Simply resets hasCameraControl.
void PixelCrushers.DialogueSystem.Sequencer.PlayCommand | ( | QueuedSequencerCommand | commandRecord | ) |
void PixelCrushers.DialogueSystem.Sequencer.PlayCommand | ( | QueuedSequencerCommand | commandRecord, |
string | commandName, | ||
bool | required, | ||
float | time, | ||
string | message, | ||
string | endMessage, | ||
params string[] | args | ||
) |
void PixelCrushers.DialogueSystem.Sequencer.PlayCommand | ( | string | commandName, |
bool | required, | ||
float | time, | ||
string | message, | ||
string | endMessage, | ||
params string[] | args | ||
) |
Schedules a command to be played.
commandName | The command to play. See Sequencer Command Reference for the list of valid commands. |
required | If 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. |
time | The time delay in seconds at which to start the command. If time is 0 , the command starts immediately. |
args | An 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);
void PixelCrushers.DialogueSystem.Sequencer.PlaySequence | ( | string | sequence | ) |
Parses a sequence string and plays the individual commands.
sequence | The sequence to play, in the form: |
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.
void PixelCrushers.DialogueSystem.Sequencer.PlaySequence | ( | string | sequence, |
bool | informParticipants, | ||
bool | destroyWhenDone | ||
) |
void PixelCrushers.DialogueSystem.Sequencer.PlaySequence | ( | string | sequence, |
Transform | speaker, | ||
Transform | listener, | ||
bool | informParticipants, | ||
bool | destroyWhenDone | ||
) |
void PixelCrushers.DialogueSystem.Sequencer.PlaySequence | ( | string | sequence, |
Transform | speaker, | ||
Transform | listener, | ||
bool | informParticipants, | ||
bool | destroyWhenDone, | ||
bool | delayOneFrame | ||
) |
IEnumerator PixelCrushers.DialogueSystem.Sequencer.PlaySequenceAfterOneFrame | ( | string | sequence, |
Transform | speaker, | ||
Transform | listener, | ||
bool | informParticipants, | ||
bool | destroyWhenDone | ||
) |
|
static |
Registers a sequencer shortcut with the Dialogue System.
When playing sequences, shortcuts wrapped in double braces are replaced by their values.
shortcut | Shortcut ID |
value | Sequence that replaces the shortcut ID. |
|
static |
void PixelCrushers.DialogueSystem.Sequencer.SetParticipants | ( | Transform | speaker, |
Transform | listener | ||
) |
void PixelCrushers.DialogueSystem.Sequencer.Stop | ( | ) |
Stops all scheduled and active commands.
void PixelCrushers.DialogueSystem.Sequencer.StopActive | ( | ) |
void PixelCrushers.DialogueSystem.Sequencer.StopQueued | ( | ) |
void PixelCrushers.DialogueSystem.Sequencer.SwitchCamera | ( | Camera | newCamera | ) |
Switches the sequencer camera to a different camera object immediately.
Restores the previous camera first.
newCamera | New camera. |
void PixelCrushers.DialogueSystem.Sequencer.TakeCameraControl | ( | ) |
Takes control of the camera.
|
static |
Unregisters a shortcut from the Dialogue System.
shortcut | Shortcut to remove. |
void PixelCrushers.DialogueSystem.Sequencer.Update | ( | ) |
void PixelCrushers.DialogueSystem.Sequencer.UseCamera | ( | Camera | sequencerCamera, |
GameObject | alternateSequencerCameraObject, | ||
GameObject | cameraAngles | ||
) |
void PixelCrushers.DialogueSystem.Sequencer.UseCamera | ( | Camera | sequencerCamera, |
GameObject | cameraAngles | ||
) |
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.
bool PixelCrushers.DialogueSystem.Sequencer.useOldParser = false |
Set true
to use the old Dialogue System parser instead of the new, improved parser.
|
get |
|
getset |
The entrytag for the current dialogue entry, if playing a dialogue entry sequence.
|
get |
|
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
.
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
getset |
The subtitle end time ({{end}}) if playing a dialogue entry sequence.
Action PixelCrushers.DialogueSystem.Sequencer.FinishedSequenceHandler = null |
This handler is called when the sequence is done playing.