PixelCrushers.DialogueSystem.SequencerTools Class Reference

A static utility class for Sequencer. More...

Static Public Member Functions

static Transform GetSubject (string specifier, Transform speaker, Transform listener, Transform defaultSubject=null)
 Sequencer commands usually specify a subject to which the command applies (e.g., where to aim the camera). More...
 
static GameObject FindSpecifier (string specifier, bool onlyActiveInScene=false)
 Finds a game object with the specified name, returning any match in scene before trying to return any non-scene matches in the project. More...
 
static string GetDefaultCameraAngle (Transform subject)
 Gets the default camera angle for a subject. More...
 
static string GetParameter (string[] parameters, int i, string defaultValue=null)
 Gets parameters[i]. More...
 
static T GetParameterAs< T > (string[] parameters, int i, T defaultValue)
 Gets parameters[i] as the specified type. More...
 
static float GetParameterAsFloat (string[] parameters, int i, float defaultValue=0)
 Gets the i-th parameter as a float. More...
 
static int GetParameterAsInt (string[] parameters, int i, int defaultValue=0)
 Gets the i-th parameter as an int. More...
 
static bool GetParameterAsBool (string[] parameters, int i, bool defaultValue=false)
 Gets the i-th parameter as a bool. More...
 
static AudioSource GetAudioSource (Transform subject)
 Gets the audio source on a subject, using the Dialogue Manager as the subject if the specified subject is null. More...
 
static bool IsAudioMuted ()
 Checks if a Lua variable "Mute" is true. More...
 

Detailed Description

A static utility class for Sequencer.

Member Function Documentation

◆ FindSpecifier()

static GameObject PixelCrushers.DialogueSystem.SequencerTools.FindSpecifier ( string  specifier,
bool  onlyActiveInScene = false 
)
static

Finds a game object with the specified name, returning any match in scene before trying to return any non-scene matches in the project.

Checks GameObjects registered with the specifier as its actor name first.

Returns
The specified game object.
Parameters
specifierThe name to search for.
onlyActiveInSceneOnly search active objects in the scene.

◆ GetAudioSource()

static AudioSource PixelCrushers.DialogueSystem.SequencerTools.GetAudioSource ( Transform  subject)
static

Gets the audio source on a subject, using the Dialogue Manager as the subject if the specified subject is null.

If no audio source exists on the subject, this method adds one.

Returns
The audio source.
Parameters
subjectSubject.

◆ GetDefaultCameraAngle()

static string PixelCrushers.DialogueSystem.SequencerTools.GetDefaultCameraAngle ( Transform  subject)
static

Gets the default camera angle for a subject.

Returns
The default camera angle. If the subject doesn't have a DefaultCameraAngle component, returns "Closeup".
Parameters
subjectSubject.

◆ GetParameter()

static string PixelCrushers.DialogueSystem.SequencerTools.GetParameter ( string[]  parameters,
int  i,
string  defaultValue = null 
)
static

Gets parameters[i].

Returns
parameters[i], or the specified default value if i is out of range.
Parameters
parametersAn array of parameters.
iThe index into parameters[]
defaultValueThe default value to return if i is out of range.

◆ GetParameterAs< T >()

static T PixelCrushers.DialogueSystem.SequencerTools.GetParameterAs< T > ( string[]  parameters,
int  i,
defaultValue 
)
static

Gets parameters[i] as the specified type.

Returns
parameters[i] as type T, or the specified default value if i is out of range or parameters[i] can't be converted to type T.
Parameters
parametersAn array of parameters.
iThe index into parameters[]
defaultValueThe default value to return if i is out of range or the parameter can't be converted to type T.
Template Parameters
TThe type to convert the parameter to.

// Get parameters[1] as a float, defaulting to 5f: float duration = GetParameterAs<float>(parameters, 1, 5f);

◆ GetParameterAsBool()

static bool PixelCrushers.DialogueSystem.SequencerTools.GetParameterAsBool ( string[]  parameters,
int  i,
bool  defaultValue = false 
)
static

Gets the i-th parameter as a bool.

Returns
The parameter as bool, or defaultValue if out of range.
Parameters
parametersThe array of parameters.
iThe zero-based index of the parameter.
defaultValueThe default value to use if the parameter doesn't exist or isn't valid for the type.

◆ GetParameterAsFloat()

static float PixelCrushers.DialogueSystem.SequencerTools.GetParameterAsFloat ( string[]  parameters,
int  i,
float  defaultValue = 0 
)
static

Gets the i-th parameter as a float.

Returns
The parameter as float, or defaultValue if out of range.
Parameters
parametersThe array of parameters.
iThe zero-based index of the parameter.
defaultValueThe default value to use if the parameter doesn't exist or isn't valid for the type.

◆ GetParameterAsInt()

static int PixelCrushers.DialogueSystem.SequencerTools.GetParameterAsInt ( string[]  parameters,
int  i,
int  defaultValue = 0 
)
static

Gets the i-th parameter as an int.

Returns
The parameter as an int, or defaultValue if out of range.
Parameters
parametersThe array of parameters.
iThe zero-based index of the parameter.
defaultValueThe default value to use if the parameter doesn't exist or isn't valid for the type.

◆ GetSubject()

static Transform PixelCrushers.DialogueSystem.SequencerTools.GetSubject ( string  specifier,
Transform  speaker,
Transform  listener,
Transform  defaultSubject = null 
)
static

Sequencer commands usually specify a subject to which the command applies (e.g., where to aim the camera).

This utility function that returns the specified subject.

Returns
The transform of the specified subject, or null if the specifier names a game object that isn't in the scene.
Parameters
specifier"speaker", "listener", or the name of a game object in the scene.
speakerSpeaker.
listenerListener.
defaultSubjectDefault subject.

◆ IsAudioMuted()

static bool PixelCrushers.DialogueSystem.SequencerTools.IsAudioMuted ( )
static

Checks if a Lua variable "Mute" is true.

Returns
true if audio is muted; otherwise, false.

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