DemiLib
A collection of Demigiant's utility libraries for Unity (https://github.com/Demigiant/demilib)
DG.DeAudio.DeAudioGroup Class Reference

Audio group, connected to an AudioMixerGroup. Create it using the DeAudioManager Inspector More...

Inheritance diagram for DG.DeAudio.DeAudioGroup:

Public Member Functions

 DeAudioGroup (DeAudioGroupId id)
 
 DeAudioGroup (DeAudioGroupId id, float volume, int maxSources=-1, int preallocate=0, bool recycle=true, AudioMixerGroup mixerGroup=null)
 
DeAudioSource Crossfade (DeAudioClipData clipData, float fadeDuration=1.5f, bool ignoreTimeScale=true, TweenCallback onComplete=null)
 Fades out then stops all sources in this group, while starting the given DeAudioClipData with a fade-in effect. More...
 
DeAudioSource Crossfade (AudioClip clip, float volume=1, float pitch=1, bool loop=false, float fadeDuration=1.5f, bool ignoreTimeScale=true, TweenCallback onComplete=null)
 Fades out then stops all sources in this group, while starting the given clip with a fade-in effect. More...
 
void Dispose ()
 
void FadeIn (float duration=1.5f, bool ignoreTimeScale=true, TweenCallback onComplete=null)
 Fades in this group's volume More...
 
void FadeOut (float duration=1.5f, bool ignoreTimeScale=true, bool stopOnComplete=true, TweenCallback onComplete=null)
 Fades out this group's volume More...
 
void FadeSourcesIn (float duration=1.5f, bool ignoreTimeScale=true)
 Fades in the volume of each source in this group (not this group's volume) More...
 
void FadeSourcesOut (float duration=1.5f, bool ignoreTimeScale=true, bool stopOnComplete=true)
 Fades out the volume of each source in this group (not this group's volume) More...
 
void FadeSourcesTo (float to, float duration=1.5f, bool ignoreTimeScale=true)
 Fades the volume of each source in this group (not this group's volume) to the given value More...
 
void FadeTo (float to, float duration=1.5f, bool ignoreTimeScale=true, TweenCallback onComplete=null)
 Fades this group's volume to the given value More...
 
DeAudioSource Play (DeAudioClipData clipData)
 Plays the given DeAudioClipData with the stored volume, pitch and loop settings. More...
 
DeAudioSource Play (AudioClip clip, float volume=1, float pitch=1, bool loop=false)
 Plays the given sound with the given options. More...
 
void SetVolume (float volume)
 Sets the volume for this group (same as setting volume directly) More...
 
void SetVolume (AudioClip clip, float volume)
 Sets the volume for all sources in this group that are using the given clip More...
 
void Stop ()
 Stops all sounds for this group More...
 
void Stop (AudioClip clip)
 Stops all sources for this group that are using the given clip More...
 
void Unlock ()
 Unlocks all DeAudioSource instances for this group More...
 
void Unlock (AudioClip clip)
 Unlocks all DeAudioSource instances for this group that are using the given clip More...
 

Public Attributes

float fooVolume = 1
 
DeAudioGroupId id
 
int maxSources = -1
 Max AudioSources for this group. DO NOT change this at runtime More...
 
AudioMixerGroup mixerGroup
 
int preallocate = 0
 
bool recycle = true
 
List< DeAudioSourcesources
 

Protected Member Functions

virtual void Dispose (bool disposing)
 

Properties

float volume [get, set]
 

Detailed Description

Audio group, connected to an AudioMixerGroup. Create it using the DeAudioManager Inspector

Constructor & Destructor Documentation

DG.DeAudio.DeAudioGroup.DeAudioGroup ( DeAudioGroupId  id)
DG.DeAudio.DeAudioGroup.DeAudioGroup ( DeAudioGroupId  id,
float  volume,
int  maxSources = -1,
int  preallocate = 0,
bool  recycle = true,
AudioMixerGroup  mixerGroup = null 
)

Member Function Documentation

DeAudioSource DG.DeAudio.DeAudioGroup.Crossfade ( DeAudioClipData  clipData,
float  fadeDuration = 1.5f,
bool  ignoreTimeScale = true,
TweenCallback  onComplete = null 
)

Fades out then stops all sources in this group, while starting the given DeAudioClipData with a fade-in effect.

Returns the DeAudioSource instance used to play, or NULL if the clip couldn't be played

DeAudioSource DG.DeAudio.DeAudioGroup.Crossfade ( AudioClip  clip,
float  volume = 1,
float  pitch = 1,
bool  loop = false,
float  fadeDuration = 1.5f,
bool  ignoreTimeScale = true,
TweenCallback  onComplete = null 
)

Fades out then stops all sources in this group, while starting the given clip with a fade-in effect.

Returns the DeAudioSource instance used to play, or NULL if the clip couldn't be played

void DG.DeAudio.DeAudioGroup.Dispose ( )
virtual void DG.DeAudio.DeAudioGroup.Dispose ( bool  disposing)
protectedvirtual
void DG.DeAudio.DeAudioGroup.FadeIn ( float  duration = 1.5f,
bool  ignoreTimeScale = true,
TweenCallback  onComplete = null 
)

Fades in this group's volume

void DG.DeAudio.DeAudioGroup.FadeOut ( float  duration = 1.5f,
bool  ignoreTimeScale = true,
bool  stopOnComplete = true,
TweenCallback  onComplete = null 
)

Fades out this group's volume

void DG.DeAudio.DeAudioGroup.FadeSourcesIn ( float  duration = 1.5f,
bool  ignoreTimeScale = true 
)

Fades in the volume of each source in this group (not this group's volume)

void DG.DeAudio.DeAudioGroup.FadeSourcesOut ( float  duration = 1.5f,
bool  ignoreTimeScale = true,
bool  stopOnComplete = true 
)

Fades out the volume of each source in this group (not this group's volume)

void DG.DeAudio.DeAudioGroup.FadeSourcesTo ( float  to,
float  duration = 1.5f,
bool  ignoreTimeScale = true 
)

Fades the volume of each source in this group (not this group's volume) to the given value

void DG.DeAudio.DeAudioGroup.FadeTo ( float  to,
float  duration = 1.5f,
bool  ignoreTimeScale = true,
TweenCallback  onComplete = null 
)

Fades this group's volume to the given value

DeAudioSource DG.DeAudio.DeAudioGroup.Play ( DeAudioClipData  clipData)

Plays the given DeAudioClipData with the stored volume, pitch and loop settings.

Returns the DeAudioSource instance used to play, or NULL if the clip couldn't be played

DeAudioSource DG.DeAudio.DeAudioGroup.Play ( AudioClip  clip,
float  volume = 1,
float  pitch = 1,
bool  loop = false 
)

Plays the given sound with the given options.

Returns the DeAudioSource instance used to play, or NULL if the clip couldn't be played

void DG.DeAudio.DeAudioGroup.SetVolume ( float  volume)

Sets the volume for this group (same as setting volume directly)

void DG.DeAudio.DeAudioGroup.SetVolume ( AudioClip  clip,
float  volume 
)

Sets the volume for all sources in this group that are using the given clip

void DG.DeAudio.DeAudioGroup.Stop ( )

Stops all sounds for this group

void DG.DeAudio.DeAudioGroup.Stop ( AudioClip  clip)

Stops all sources for this group that are using the given clip

void DG.DeAudio.DeAudioGroup.Unlock ( )

Unlocks all DeAudioSource instances for this group

void DG.DeAudio.DeAudioGroup.Unlock ( AudioClip  clip)

Unlocks all DeAudioSource instances for this group that are using the given clip

Member Data Documentation

float DG.DeAudio.DeAudioGroup.fooVolume = 1
DeAudioGroupId DG.DeAudio.DeAudioGroup.id
int DG.DeAudio.DeAudioGroup.maxSources = -1

Max AudioSources for this group. DO NOT change this at runtime

AudioMixerGroup DG.DeAudio.DeAudioGroup.mixerGroup
int DG.DeAudio.DeAudioGroup.preallocate = 0
bool DG.DeAudio.DeAudioGroup.recycle = true
List<DeAudioSource> DG.DeAudio.DeAudioGroup.sources

Property Documentation

float DG.DeAudio.DeAudioGroup.volume
getset

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