Master Audio - AAA Sound Solution!  v2022
The ultimate AAA audio config tool
DarkTonic.MasterAudio.AudioTransformExtensions Class Reference

This class contains extension methods so you can call some Master Audio methods with less parameters directly from the Transform object. More...

Static Public Member Functions

static void FadeOutSoundGroupOfTransform (this Transform sourceTrans, string sType, float fadeTime)
 This method allows you to fade out all sounds of a particular Sound Group triggered by or following a Transform for X seconds. More...
 
static List< SoundGroupVariationGetAllPlayingVariationsOfTransform (this Transform sourceTrans)
 This will return a list of all playing Variations of a Transform More...
 
static bool PlaySound3DAtTransformAndForget (this Transform sourceTrans, string sType, float volumePercentage=1f, float?pitch=null, float delaySoundTime=0f, string variationName=null)
 This method allows you to play a sound in a Sound Group from a specific position - the position of a Transform you pass in. Returns bool indicating success (played) or not. More...
 
static PlaySoundResult PlaySound3DAtTransform (this Transform sourceTrans, string sType, float volumePercentage=1f, float?pitch=null, float delaySoundTime=0f, string variationName=null)
 This method allows you to play a sound in a Sound Group from a specific position - the position of a Transform you pass in. More...
 
static bool PlaySound3DFollowTransformAndForget (this Transform sourceTrans, string sType, float volumePercentage=1f, float?pitch=null, float delaySoundTime=0f, string variationName=null)
 This method allows you to play a sound in a Sound Group from a specific position - a Transform you pass in. Returns bool indicating success (played) or not. More...
 
static PlaySoundResult PlaySound3DFollowTransform (this Transform sourceTrans, string sType, float volumePercentage=1f, float?pitch=null, float delaySoundTime=0f, string variationName=null)
 This method allows you to play a sound in a Sound Group from a specific position - a Transform you pass in, and it will follow the Transform if it moves. Returns a PlaySoundResult. More...
 
static IEnumerator PlaySound3DAtTransformAndWaitUntilFinished (this Transform sourceTrans, string sType, float volumePercentage=1f, float?pitch=null, float delaySoundTime=0f, string variationName=null, double?timeToSchedulePlay=null, System.Action completedAction=null)
 This method allows you to play a sound in a Sound Group from a specific position - a Transform you pass in. This method will not return until the sound is finished (or cannot play) to continue execution. You need to call this with StartCoroutine. The sound will not be played looped, since that could cause a Coroutine that would never end. More...
 
static IEnumerator PlaySound3DFollowTransformAndWaitUntilFinished (this Transform sourceTrans, string sType, float volumePercentage=1f, float?pitch=null, float delaySoundTime=0f, string variationName=null, double?timeToSchedulePlay=null, System.Action completedAction=null)
 This method allows you to play a sound in a Sound Group from a specific position - a Transform you pass in, and it will follow the Transform if it moves. This method will not return until the sound is finished (or cannot play) to continue execution. You need to call this with StartCoroutine. The sound will not be played looped, since that could cause a Coroutine that would never end. More...
 
static void PauseAllSoundsOfTransform (Transform sourceTrans)
 This method allows you to pause all sounds triggered by or following a Transform. More...
 
static void PauseBusOfTransform (this Transform sourceTrans, string busName)
 This method allows you to pause all sounds of a particular Bus triggered by or following a Transform More...
 
static void PauseSoundGroupOfTransform (this Transform sourceTrans, string sType)
 This method allows you to pause all sounds of a particular Sound Group triggered by or following a Transform. More...
 
static void StopAllSoundsOfTransform (this Transform sourceTrans)
 This method allows you to abruptly stop all sounds triggered by or following a Transform. More...
 
static void StopBusOfTransform (this Transform sourceTrans, string busName)
 This method allows you to stop all sounds of a particular Bus triggered by or following a Transform More...
 
static void StopSoundGroupOfTransform (this Transform sourceTrans, string sType)
 This method allows you to abruptly stop all sounds of a particular Sound Group triggered by or following a Transform. More...
 
static void UnpauseAllSoundsOfTransform (this Transform sourceTrans)
 This method allows you to unpause all sounds triggered by or following a Transform. More...
 
static void UnpauseBusOfTransform (this Transform sourceTrans, string busName)
 This method allows you to unpause all sounds of a particular Bus triggered by or following a Transform More...
 
static void UnpauseSoundGroupOfTransform (this Transform sourceTrans, string sType)
 This method allows you to unpause all sounds of a particular Sound Group triggered by or following a Transform. More...
 
static bool IsTransformPlayingSoundGroup (this Transform sourceTrans, string sType)
 Will return whether the Sound Group you specify is played by a Transform you pass in. More...
 

Detailed Description

This class contains extension methods so you can call some Master Audio methods with less parameters directly from the Transform object.

Member Function Documentation

static void DarkTonic.MasterAudio.AudioTransformExtensions.FadeOutSoundGroupOfTransform ( this Transform  sourceTrans,
string  sType,
float  fadeTime 
)
static

This method allows you to fade out all sounds of a particular Sound Group triggered by or following a Transform for X seconds.

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.
sTypeThe name of the Sound Group.
fadeTimeThe amount of seconds the fading will take.
static List<SoundGroupVariation> DarkTonic.MasterAudio.AudioTransformExtensions.GetAllPlayingVariationsOfTransform ( this Transform  sourceTrans)
static

This will return a list of all playing Variations of a Transform

Parameters
sourceTransSource transform
Returns
List of SoundGroupVariation
static bool DarkTonic.MasterAudio.AudioTransformExtensions.IsTransformPlayingSoundGroup ( this Transform  sourceTrans,
string  sType 
)
static

Will return whether the Sound Group you specify is played by a Transform you pass in.

Parameters
sTypeSound Group name
sourceTransThe Transform in question
Returns
boolean
static void DarkTonic.MasterAudio.AudioTransformExtensions.PauseAllSoundsOfTransform ( Transform  sourceTrans)
static

This method allows you to pause all sounds triggered by or following a Transform.

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.
static void DarkTonic.MasterAudio.AudioTransformExtensions.PauseBusOfTransform ( this Transform  sourceTrans,
string  busName 
)
static

This method allows you to pause all sounds of a particular Bus triggered by or following a Transform

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.
busNameThe name of the Bus.
static void DarkTonic.MasterAudio.AudioTransformExtensions.PauseSoundGroupOfTransform ( this Transform  sourceTrans,
string  sType 
)
static

This method allows you to pause all sounds of a particular Sound Group triggered by or following a Transform.

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.
sTypeThe name of the Sound Group to stop.
static PlaySoundResult DarkTonic.MasterAudio.AudioTransformExtensions.PlaySound3DAtTransform ( this Transform  sourceTrans,
string  sType,
float  volumePercentage = 1f,
float?  pitch = null,
float  delaySoundTime = 0f,
string  variationName = null 
)
static

This method allows you to play a sound in a Sound Group from a specific position - the position of a Transform you pass in.

Parameters
sTypeThe name of the Sound Group to trigger a sound from.
sourceTransThe Transform whose position you want the sound to eminate from.
volumePercentageOptional - used if you want to play the sound at a reduced volume (between 0 and 1).
pitchOptional - used if you want to play the sound at a specific pitch. If you do, it will override the pich and random pitch in the variation.
delaySoundTimeOptional - used if you want to play the sound X seconds from now instead of immediately.
variationNameOptional - used if you want to play a specific variation by name. Otherwise a random variation is played.
Returns
PlaySoundResult - this object can be used to read if the sound played or not and also gives access to the Variation object that was used.
static bool DarkTonic.MasterAudio.AudioTransformExtensions.PlaySound3DAtTransformAndForget ( this Transform  sourceTrans,
string  sType,
float  volumePercentage = 1f,
float?  pitch = null,
float  delaySoundTime = 0f,
string  variationName = null 
)
static

This method allows you to play a sound in a Sound Group from a specific position - the position of a Transform you pass in. Returns bool indicating success (played) or not.

Parameters
sTypeThe name of the Sound Group to trigger a sound from.
sourceTransThe Transform whose position you want the sound to eminate from.
volumePercentageOptional - used if you want to play the sound at a reduced volume (between 0 and 1).
pitchOptional - used if you want to play the sound at a specific pitch. If you do, it will override the pich and random pitch in the variation.
delaySoundTimeOptional - used if you want to play the sound X seconds from now instead of immediately.
variationNameOptional - used if you want to play a specific variation by name. Otherwise a random variation is played.
Returns
boolean- true indicating that the sound was either played or scheduled, false otherwise.
static IEnumerator DarkTonic.MasterAudio.AudioTransformExtensions.PlaySound3DAtTransformAndWaitUntilFinished ( this Transform  sourceTrans,
string  sType,
float  volumePercentage = 1f,
float?  pitch = null,
float  delaySoundTime = 0f,
string  variationName = null,
double?  timeToSchedulePlay = null,
System.Action  completedAction = null 
)
static

This method allows you to play a sound in a Sound Group from a specific position - a Transform you pass in. This method will not return until the sound is finished (or cannot play) to continue execution. You need to call this with StartCoroutine. The sound will not be played looped, since that could cause a Coroutine that would never end.

Parameters
sTypeThe name of the Sound Group to trigger a sound from.
sourceTransThe Transform whose position you want the sound to eminate from. Pass null if you want to play the sound 2D.
volumePercentageOptional - used if you want to play the sound at a reduced volume (between 0 and 1).
pitchOptional - used if you want to play the sound at a specific pitch. If you do, it will override the pich and random pitch in the variation.
delaySoundTimeOptional - used if you want to play the sound X seconds from now instead of immediately.
variationNameOptional - used if you want to play a specific variation by name. Otherwise a random variation is played.
timeToSchedulePlayOptional - used to pass in the DSP time to play the sound. Normally do not use this, use the delaySoundTime param instead.
completedActionOptional - Code to execute when the sound is finished.
static PlaySoundResult DarkTonic.MasterAudio.AudioTransformExtensions.PlaySound3DFollowTransform ( this Transform  sourceTrans,
string  sType,
float  volumePercentage = 1f,
float?  pitch = null,
float  delaySoundTime = 0f,
string  variationName = null 
)
static

This method allows you to play a sound in a Sound Group from a specific position - a Transform you pass in, and it will follow the Transform if it moves. Returns a PlaySoundResult.

Parameters
sTypeThe name of the Sound Group to trigger a sound from.
sourceTransThe Transform whose position you want the sound to eminate from.
volumePercentageOptional - used if you want to play the sound at a reduced volume (between 0 and 1).
pitchOptional - used if you want to play the sound at a specific pitch. If you do, it will override the pich and random pitch in the variation.
delaySoundTimeOptional - used if you want to play the sound X seconds from now instead of immediately.
variationNameOptional - used if you want to play a specific variation by name. Otherwise a random variation is played.
Returns
PlaySoundResult - this object can be used to read if the sound played or not and also gives access to the Variation object that was used.
static bool DarkTonic.MasterAudio.AudioTransformExtensions.PlaySound3DFollowTransformAndForget ( this Transform  sourceTrans,
string  sType,
float  volumePercentage = 1f,
float?  pitch = null,
float  delaySoundTime = 0f,
string  variationName = null 
)
static

This method allows you to play a sound in a Sound Group from a specific position - a Transform you pass in. Returns bool indicating success (played) or not.

Parameters
sTypeThe name of the Sound Group to trigger a sound from.
sourceTransThe Transform whose position you want the sound to eminate from.
volumePercentageOptional - used if you want to play the sound at a reduced volume (between 0 and 1).
pitchOptional - used if you want to play the sound at a specific pitch. If you do, it will override the pich and random pitch in the variation.
delaySoundTimeOptional - used if you want to play the sound X seconds from now instead of immediately.
variationNameOptional - used if you want to play a specific variation by name. Otherwise a random variation is played.
Returns
boolean- true indicating that the sound was either played or scheduled, false otherwise.
static IEnumerator DarkTonic.MasterAudio.AudioTransformExtensions.PlaySound3DFollowTransformAndWaitUntilFinished ( this Transform  sourceTrans,
string  sType,
float  volumePercentage = 1f,
float?  pitch = null,
float  delaySoundTime = 0f,
string  variationName = null,
double?  timeToSchedulePlay = null,
System.Action  completedAction = null 
)
static

This method allows you to play a sound in a Sound Group from a specific position - a Transform you pass in, and it will follow the Transform if it moves. This method will not return until the sound is finished (or cannot play) to continue execution. You need to call this with StartCoroutine. The sound will not be played looped, since that could cause a Coroutine that would never end.

Parameters
sTypeThe name of the Sound Group to trigger a sound from.
sourceTransThe Transform whose position you want the sound to eminate from. Pass null if you want to play the sound 2D.
volumePercentageOptional - used if you want to play the sound at a reduced volume (between 0 and 1).
pitchOptional - used if you want to play the sound at a specific pitch. If you do, it will override the pich and random pitch in the variation.
delaySoundTimeOptional - used if you want to play the sound X seconds from now instead of immediately.
variationNameOptional - used if you want to play a specific variation by name. Otherwise a random variation is played.
timeToSchedulePlayOptional - used to pass in the DSP time to play the sound. Normally do not use this, use the delaySoundTime param instead.
completedActionOptional - Code to execute when the sound is finished.
static void DarkTonic.MasterAudio.AudioTransformExtensions.StopAllSoundsOfTransform ( this Transform  sourceTrans)
static

This method allows you to abruptly stop all sounds triggered by or following a Transform.

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.
static void DarkTonic.MasterAudio.AudioTransformExtensions.StopBusOfTransform ( this Transform  sourceTrans,
string  busName 
)
static

This method allows you to stop all sounds of a particular Bus triggered by or following a Transform

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.
busNameThe name of the Bus.
static void DarkTonic.MasterAudio.AudioTransformExtensions.StopSoundGroupOfTransform ( this Transform  sourceTrans,
string  sType 
)
static

This method allows you to abruptly stop all sounds of a particular Sound Group triggered by or following a Transform.

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.
sTypeThe name of the Sound Group to stop.
static void DarkTonic.MasterAudio.AudioTransformExtensions.UnpauseAllSoundsOfTransform ( this Transform  sourceTrans)
static

This method allows you to unpause all sounds triggered by or following a Transform.

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.
static void DarkTonic.MasterAudio.AudioTransformExtensions.UnpauseBusOfTransform ( this Transform  sourceTrans,
string  busName 
)
static

This method allows you to unpause all sounds of a particular Bus triggered by or following a Transform

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.
busNameThe name of the Bus.
static void DarkTonic.MasterAudio.AudioTransformExtensions.UnpauseSoundGroupOfTransform ( this Transform  sourceTrans,
string  sType 
)
static

This method allows you to unpause all sounds of a particular Sound Group triggered by or following a Transform.

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.
sTypeThe name of the Sound Group to stop.

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