PixelCrushers.DialogueSystem.SequencerTools Class Reference

A static utility class for Sequencer. More...

Static Public Member Functions

static void HookIntoSceneLoaded ()
 
static void RegisterSubject (Transform subject)
 Registers a GameObject by name for faster lookup.
 
static void UnregisterSubject (Transform subject)
 Unregisters a registered GameObject.
 
static void CleanNullSubjects ()
 Clears null entries from registeredSubjects.
 
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).
 
static bool SpecifierSpecifiesTag (string specifier)
 Returns true if specifier specifies a tag ('tag=foo').
 
static string GetSpecifiedTag (string specifier)
 Assumes specifier specifies a tag ('tag=foo').
 
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.
 
static Transform GetPortraitImage (Transform subject)
 
Returns
The transform of the Portrait Image GameObject, or null if not found.

 
static string GetDefaultCameraAngle (Transform subject)
 Gets the default camera angle for a subject.
 
static string GetParameter (string[] parameters, int i, string defaultValue=null)
 Gets parameters[i].
 
static T GetParameterAs< T > (string[] parameters, int i, T defaultValue)
 Gets parameters[i] as the specified type.
 
static float GetParameterAsFloat (string[] parameters, int i, float defaultValue=0)
 Gets the i-th parameter as a float.
 
static int GetParameterAsInt (string[] parameters, int i, int defaultValue=0)
 Gets the i-th parameter as an int.
 
static bool GetParameterAsBool (string[] parameters, int i, bool defaultValue=false)
 Gets the i-th parameter as a bool.
 
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.
 
static bool IsAudioMuted ()
 Checks if a Lua variable "Mute" is true.
 

Detailed Description

A static utility class for Sequencer.

Member Function Documentation

◆ CleanNullSubjects()

static void PixelCrushers.DialogueSystem.SequencerTools.CleanNullSubjects ( )
inlinestatic

Clears null entries from registeredSubjects.

◆ FindSpecifier()

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

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

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

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

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

Gets parameters[i] as the specified type.

Culture invariant (i.e., floats use '.' for decimal point).

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

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

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

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.

◆ GetPortraitImage()

static Transform PixelCrushers.DialogueSystem.SequencerTools.GetPortraitImage ( Transform  subject)
inlinestatic

Returns
The transform of the Portrait Image GameObject, or null if not found.

Must be using Standard Dialogue UI. Not for use with simultaneous conversations.

◆ GetSpecifiedTag()

static string PixelCrushers.DialogueSystem.SequencerTools.GetSpecifiedTag ( string  specifier)
inlinestatic

Assumes specifier specifies a tag ('tag=foo').

Returns the tag.

◆ GetSubject()

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

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.

◆ HookIntoSceneLoaded()

static void PixelCrushers.DialogueSystem.SequencerTools.HookIntoSceneLoaded ( )
inlinestatic

◆ IsAudioMuted()

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

Checks if a Lua variable "Mute" is true.

Returns
true if audio is muted; otherwise, false.

◆ RegisterSubject()

static void PixelCrushers.DialogueSystem.SequencerTools.RegisterSubject ( Transform  subject)
inlinestatic

Registers a GameObject by name for faster lookup.

◆ SpecifierSpecifiesTag()

static bool PixelCrushers.DialogueSystem.SequencerTools.SpecifierSpecifiesTag ( string  specifier)
inlinestatic

Returns true if specifier specifies a tag ('tag=foo').

◆ UnregisterSubject()

static void PixelCrushers.DialogueSystem.SequencerTools.UnregisterSubject ( Transform  subject)
inlinestatic

Unregisters a registered GameObject.


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