Documentation for the Unity C# Library
Loading...
Searching...
No Matches
Hellmade.Sound.EazySoundManager Class Reference

Static class responsible for playing and managing audio and sounds. More...

Inheritance diagram for Hellmade.Sound.EazySoundManager:
[legend]

Static Public Member Functions

static Audio GetAudio (AudioClip audioClip)
 Returns the first occurrence of Audio that plays the given audioClip. Returns null if no such Audio is found.
 
static Audio GetAudio (int audioID)
 Returns the Audio that has as its id the audioID if one is found, returns null if no such Audio is found.
 
static Audio GetAudio (string name)
 
static Audio GetMusicAudio (AudioClip audioClip)
 Returns the first occurrence of music Audio that plays the given audioClip. Returns null if no such Audio is found.
 
static Audio GetMusicAudio (int audioID)
 Returns the music Audio that has as its id the audioID if one is found, returns null if no such Audio is found.
 
static Audio GetMusicAudio (string name)
 
static Audio GetSoundAudio (AudioClip audioClip)
 Returns the first occurrence of sound Audio that plays the given audioClip. Returns null if no such Audio is found.
 
static Audio GetSoundAudio (int audioID)
 Returns the sound fx Audio that has as its id the audioID if one is found, returns null if no such Audio is found.
 
static Audio GetSoundAudio (string name)
 
static Audio GetUISoundAudio (AudioClip audioClip)
 Returns the first occurrence of UI sound Audio that plays the given audioClip. Returns null if no such Audio is found.
 
static Audio GetUISoundAudio (int audioID)
 Returns the UI sound fx Audio that has as its id the audioID if one is found, returns null if no such Audio is found.
 
static Audio GetUISoundAudio (string name)
 
static void PauseAll ()
 Pause all audio playing.
 
static void PauseAllMusic ()
 Pause all music playing.
 
static void PauseAllSounds ()
 Pause all sound fx playing.
 
static void PauseAllUISounds ()
 Pause all UI sound fx playing.
 
static int PlayMusic (AudioClip clip)
 Play background music.
 
static int PlayMusic (AudioClip clip, float volume)
 Play background music.
 
static int PlayMusic (AudioClip clip, float volume, bool loop, bool persist)
 Play background music.
 
static int PlayMusic (AudioClip clip, float volume, bool loop, bool persist, float fadeInSeconds, float fadeOutSeconds)
 Play background music.
 
static int PlayMusic (AudioClip clip, float volume, bool loop, bool persist, float fadeInSeconds, float fadeOutSeconds, float currentMusicfadeOutSeconds, Transform sourceTransform)
 Play background music.
 
static int PlaySound (AudioClip clip, string name)
 
static int PlaySound (AudioClip clip, string name, bool loop)
 Play a sound fx.
 
static int PlaySound (AudioClip clip, string name, float volume)
 
static int PlaySound (AudioClip clip, string name, float volume, bool loop)
 
static int PlaySound (AudioClip clip, string name, float volume, bool loop, Transform sourceTransform)
 Play a sound fx.
 
static int PlayUISound (AudioClip clip)
 Play a UI sound fx.
 
static int PlayUISound (AudioClip clip, float volume)
 Play a UI sound fx.
 
static int PrepareMusic (AudioClip clip)
 Prepares and initializes background music.
 
static int PrepareMusic (AudioClip clip, float volume)
 Prepares and initializes background music.
 
static int PrepareMusic (AudioClip clip, float volume, bool loop, bool persist)
 Prepares and initializes background music.
 
static int PrepareMusic (AudioClip clip, float volume, bool loop, bool persist, float fadeInSeconds, float fadeOutSeconds)
 Prerpares and initializes background music.
 
static int PrepareMusic (AudioClip clip, float volume, bool loop, bool persist, float fadeInSeconds, float fadeOutSeconds, float currentMusicfadeOutSeconds, Transform sourceTransform)
 Prepares and initializes background music.
 
static int PrepareSound (AudioClip clip, string name)
 Prepares and initializes a sound fx.
 
static int PrepareSound (AudioClip clip, string name, bool loop)
 Prepares and initializes a sound fx.
 
static int PrepareSound (AudioClip clip, string name, float volume)
 Prepares and initializes a sound fx.
 
static int PrepareSound (AudioClip clip, string name, float volume, bool loop, Transform sourceTransform)
 Prepares and initializes a sound fx.
 
static int PrepareUISound (AudioClip clip, string name)
 Prepares and initializes a UI sound fx.
 
static int PrepareUISound (AudioClip clip, string name, float volume)
 Prepares and initializes a UI sound fx.
 
static bool RestoreAudioFromPool (Audio.AudioType audioType, int audioID)
 Restores and re-adds a pooled audio to its corresponding audio dictionary.
 
static void ResumeAll ()
 Resume all audio playing.
 
static void ResumeAllMusic ()
 Resume all music playing.
 
static void ResumeAllSounds ()
 Resume all sound fx playing.
 
static void ResumeAllUISounds ()
 Resume all UI sound fx playing.
 
static void StopAll ()
 Stop all audio playing.
 
static void StopAll (float musicFadeOutSeconds)
 Stop all audio playing.
 
static void StopAllMusic ()
 Stop all music playing.
 
static void StopAllMusic (float fadeOutSeconds)
 Stop all music playing.
 
static void StopAllSounds ()
 Stop all sound fx playing.
 
static void StopAllUISounds ()
 Stop all UI sound fx playing.
 

Properties

static GameObject Gameobject [get]
 The gameobject that the sound manager is attached to.
 
static float GlobalMusicVolume [get, set]
 Global music volume.
 
static float GlobalSoundsVolume [get, set]
 Global sounds volume.
 
static float GlobalUISoundsVolume [get, set]
 Global UI sounds volume.
 
static float GlobalVolume [get, set]
 Global volume.
 
static bool IgnoreDuplicateMusic [get, set]
 When set to true, new music audios that have the same audio clip as any other music audios, will be ignored.
 
static bool IgnoreDuplicateSounds [get, set]
 When set to true, new sound audios that have the same audio clip as any other sound audios, will be ignored.
 
static bool IgnoreDuplicateUISounds [get, set]
 When set to true, new UI sound audios that have the same audio clip as any other UI sound audios, will be ignored.
 
static EazySoundManager Instance [get]
 

Events

static Action< AudioAudioStopped
 

Private Member Functions

void Init ()
 Initialized the sound manager.
 
void OnDisable ()
 
void OnEnable ()
 
void OnSceneLoaded (Scene scene, LoadSceneMode mode)
 Event triggered when a new scene is loaded.
 
void Update ()
 

Static Private Member Functions

static EazySoundManager ()
 
static Audio GetAudio (Audio.AudioType audioType, bool usePool, AudioClip audioClip)
 
static Audio GetAudio (Audio.AudioType audioType, bool usePool, int audioID)
 
static Audio GetAudio (Audio.AudioType audioType, bool usePool, string name)
 
static Dictionary< int, AudioGetAudioTypeDictionary (Audio.AudioType audioType)
 Retrieves the audio dictionary based on the audioType.
 
static bool GetAudioTypeIgnoreDuplicateSetting (Audio.AudioType audioType)
 Retrieves the IgnoreDuplicates setting of audios of a specified audio type.
 
static void PauseAllAudio (Audio.AudioType audioType)
 
static int PlayAudio (Audio.AudioType audioType, AudioClip clip, float volume, bool loop, bool persist, float fadeInSeconds, float fadeOutSeconds, float currentMusicfadeOutSeconds, Transform sourceTransform)
 
static int PlayAudio (string name, Audio.AudioType audioType, AudioClip clip, float volume, bool loop, bool persist, float fadeInSeconds, float fadeOutSeconds, float currentMusicfadeOutSeconds, Transform sourceTransform)
 
static int PrepareAudio (Audio.AudioType audioType, AudioClip clip, float volume, bool loop, bool persist, float fadeInSeconds, float fadeOutSeconds, float currentMusicfadeOutSeconds, Transform sourceTransform)
 
static int PrepareAudio (string name, Audio.AudioType audioType, AudioClip clip, float volume, bool loop, bool persist, float fadeInSeconds, float fadeOutSeconds, float currentMusicfadeOutSeconds, Transform sourceTransform)
 
static void RemoveNonPersistAudio (Dictionary< int, Audio > audioDict)
 Remove all non-persistant audios from an audio dictionary.
 
static void ResumeAllAudio (Audio.AudioType audioType)
 
static void StopAllAudio (Audio.AudioType audioType, float fadeOutSeconds)
 
static void UpdateAllAudio (Dictionary< int, Audio > audioDict)
 Updates the state of all audios of an audio dictionary.
 

Static Private Attributes

static Dictionary< int, AudioaudioPool
 
static bool initialized = false
 
static EazySoundManager instance = null
 
static Dictionary< int, AudiomusicAudio
 
static Dictionary< int, AudiosoundsAudio
 
static Dictionary< int, AudioUISoundsAudio
 

Detailed Description

Static class responsible for playing and managing audio and sounds.

Definition at line 12 of file EazySoundManager.cs.

Constructor & Destructor Documentation

◆ EazySoundManager()

static Hellmade.Sound.EazySoundManager.EazySoundManager ( )
inlinestaticprivate

Definition at line 86 of file EazySoundManager.cs.

Here is the call graph for this function:

Member Function Documentation

◆ GetAudio() [1/6]

static Audio Hellmade.Sound.EazySoundManager.GetAudio ( Audio::AudioType audioType,
bool usePool,
AudioClip audioClip )
inlinestaticprivate

Definition at line 456 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ GetAudio() [2/6]

static Audio Hellmade.Sound.EazySoundManager.GetAudio ( Audio::AudioType audioType,
bool usePool,
int audioID )
inlinestaticprivate

Definition at line 430 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ GetAudio() [3/6]

static Audio Hellmade.Sound.EazySoundManager.GetAudio ( Audio::AudioType audioType,
bool usePool,
string name )
inlinestaticprivate

Definition at line 447 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ GetAudio() [4/6]

static Audio Hellmade.Sound.EazySoundManager.GetAudio ( AudioClip audioClip)
inlinestatic

Returns the first occurrence of Audio that plays the given audioClip. Returns null if no such Audio is found.

Parameters
audioClipThe audio clip of the Audio to be retrieved
Returns
First occurrence of Audio that has as plays the audioClip, null if no such Audio is found

Definition at line 332 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ GetAudio() [5/6]

static Audio Hellmade.Sound.EazySoundManager.GetAudio ( int audioID)
inlinestatic

Returns the Audio that has as its id the audioID if one is found, returns null if no such Audio is found.

Parameters
audioIDThe id of the Audio to be retrieved
Returns
Audio that has as its id the audioID, null if no such Audio is found

Definition at line 277 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAudio() [6/6]

static Audio Hellmade.Sound.EazySoundManager.GetAudio ( string name)
inlinestatic

Definition at line 302 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ GetAudioTypeDictionary()

static Dictionary< int, Audio > Hellmade.Sound.EazySoundManager.GetAudioTypeDictionary ( Audio::AudioType audioType)
inlinestaticprivate

Retrieves the audio dictionary based on the audioType.

Parameters
audioTypeThe audio type of the dictionary to return
Returns
An audio dictionary

Definition at line 152 of file EazySoundManager.cs.

Here is the caller graph for this function:

◆ GetAudioTypeIgnoreDuplicateSetting()

static bool Hellmade.Sound.EazySoundManager.GetAudioTypeIgnoreDuplicateSetting ( Audio::AudioType audioType)
inlinestaticprivate

Retrieves the IgnoreDuplicates setting of audios of a specified audio type.

Parameters
audioTypeThe audio type that the returned IgnoreDuplicates setting affects
Returns
An IgnoreDuplicates setting (bool)

Definition at line 176 of file EazySoundManager.cs.

Here is the caller graph for this function:

◆ GetMusicAudio() [1/3]

static Audio Hellmade.Sound.EazySoundManager.GetMusicAudio ( AudioClip audioClip)
inlinestatic

Returns the first occurrence of music Audio that plays the given audioClip. Returns null if no such Audio is found.

Parameters
audioClipThe audio clip of the music Audio to be retrieved
Returns
First occurrence of music Audio that has as plays the audioClip, null if no such Audio is found

Definition at line 370 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ GetMusicAudio() [2/3]

static Audio Hellmade.Sound.EazySoundManager.GetMusicAudio ( int audioID)
inlinestatic

Returns the music Audio that has as its id the audioID if one is found, returns null if no such Audio is found.

Parameters
audioIDThe id of the music Audio to be returned
Returns
Music Audio that has as its id the audioID if one is found, null if no such Audio is found

Definition at line 360 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetMusicAudio() [3/3]

static Audio Hellmade.Sound.EazySoundManager.GetMusicAudio ( string name)
inlinestatic

Definition at line 385 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ GetSoundAudio() [1/3]

static Audio Hellmade.Sound.EazySoundManager.GetSoundAudio ( AudioClip audioClip)
inlinestatic

Returns the first occurrence of sound Audio that plays the given audioClip. Returns null if no such Audio is found.

Parameters
audioClipThe audio clip of the sound Audio to be retrieved
Returns
First occurrence of sound Audio that has as plays the audioClip, null if no such Audio is found

Definition at line 405 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ GetSoundAudio() [2/3]

static Audio Hellmade.Sound.EazySoundManager.GetSoundAudio ( int audioID)
inlinestatic

Returns the sound fx Audio that has as its id the audioID if one is found, returns null if no such Audio is found.

Parameters
audioIDThe id of the sound fx Audio to be returned
Returns
Sound fx Audio that has as its id the audioID if one is found, null if no such Audio is found

Definition at line 380 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSoundAudio() [3/3]

static Audio Hellmade.Sound.EazySoundManager.GetSoundAudio ( string name)
inlinestatic

Definition at line 390 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ GetUISoundAudio() [1/3]

static Audio Hellmade.Sound.EazySoundManager.GetUISoundAudio ( AudioClip audioClip)
inlinestatic

Returns the first occurrence of UI sound Audio that plays the given audioClip. Returns null if no such Audio is found.

Parameters
audioClipThe audio clip of the UI sound Audio to be retrieved
Returns
First occurrence of UI sound Audio that has as plays the audioClip, null if no such Audio is found

Definition at line 425 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ GetUISoundAudio() [2/3]

static Audio Hellmade.Sound.EazySoundManager.GetUISoundAudio ( int audioID)
inlinestatic

Returns the UI sound fx Audio that has as its id the audioID if one is found, returns null if no such Audio is found.

Parameters
audioIDThe id of the UI sound fx Audio to be returned
Returns
UI sound fx Audio that has as its id the audioID if one is found, null if no such Audio is found

Definition at line 415 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ GetUISoundAudio() [3/3]

static Audio Hellmade.Sound.EazySoundManager.GetUISoundAudio ( string name)
inlinestatic

Definition at line 395 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Init()

void Hellmade.Sound.EazySoundManager.Init ( )
inlineprivate

Initialized the sound manager.

Definition at line 94 of file EazySoundManager.cs.

Here is the caller graph for this function:

◆ OnDisable()

void Hellmade.Sound.EazySoundManager.OnDisable ( )
inlineprivate

Definition at line 122 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ OnEnable()

void Hellmade.Sound.EazySoundManager.OnEnable ( )
inlineprivate

Definition at line 117 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ OnSceneLoaded()

void Hellmade.Sound.EazySoundManager.OnSceneLoaded ( Scene scene,
LoadSceneMode mode )
inlineprivate

Event triggered when a new scene is loaded.

Parameters
sceneThe scene that is loaded
modeThe scene load mode

Definition at line 132 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PauseAll()

static void Hellmade.Sound.EazySoundManager.PauseAll ( )
inlinestatic

Pause all audio playing.

Definition at line 939 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PauseAllAudio()

static void Hellmade.Sound.EazySoundManager.PauseAllAudio ( Audio::AudioType audioType)
inlinestaticprivate

Definition at line 970 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PauseAllMusic()

static void Hellmade.Sound.EazySoundManager.PauseAllMusic ( )
inlinestatic

Pause all music playing.

Definition at line 949 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PauseAllSounds()

static void Hellmade.Sound.EazySoundManager.PauseAllSounds ( )
inlinestatic

Pause all sound fx playing.

Definition at line 957 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PauseAllUISounds()

static void Hellmade.Sound.EazySoundManager.PauseAllUISounds ( )
inlinestatic

Pause all UI sound fx playing.

Definition at line 965 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PlayAudio() [1/2]

static int Hellmade.Sound.EazySoundManager.PlayAudio ( Audio::AudioType audioType,
AudioClip clip,
float volume,
bool loop,
bool persist,
float fadeInSeconds,
float fadeOutSeconds,
float currentMusicfadeOutSeconds,
Transform sourceTransform )
inlinestaticprivate

Definition at line 825 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PlayAudio() [2/2]

static int Hellmade.Sound.EazySoundManager.PlayAudio ( string name,
Audio::AudioType audioType,
AudioClip clip,
float volume,
bool loop,
bool persist,
float fadeInSeconds,
float fadeOutSeconds,
float currentMusicfadeOutSeconds,
Transform sourceTransform )
inlinestaticprivate

Definition at line 842 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PlayMusic() [1/5]

static int Hellmade.Sound.EazySoundManager.PlayMusic ( AudioClip clip)
inlinestatic

Play background music.

Parameters
clipThe audio clip to play
Returns
The ID of the created Audio object

Definition at line 700 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PlayMusic() [2/5]

static int Hellmade.Sound.EazySoundManager.PlayMusic ( AudioClip clip,
float volume )
inlinestatic

Play background music.

Parameters
clipThe audio clip to play
volumeThe volume the music will have
Returns
The ID of the created Audio object

Definition at line 711 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PlayMusic() [3/5]

static int Hellmade.Sound.EazySoundManager.PlayMusic ( AudioClip clip,
float volume,
bool loop,
bool persist )
inlinestatic

Play background music.

Parameters
clipThe audio clip to play
volumeThe volume the music will have
loopWether the music is looped
persistWhether the audio persists in between scene changes
Returns
The ID of the created Audio object

Definition at line 724 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PlayMusic() [4/5]

static int Hellmade.Sound.EazySoundManager.PlayMusic ( AudioClip clip,
float volume,
bool loop,
bool persist,
float fadeInSeconds,
float fadeOutSeconds )
inlinestatic

Play background music.

Parameters
clipThe audio clip to play
volumeThe volume the music will have
loopWether the music is looped
persistWhether the audio persists in between scene changes
fadeInSecondsHow many seconds it needs for the audio to fade in/ reach target volume (if higher than current)
fadeOutSecondsHow many seconds it needs for the audio to fade out/ reach target volume (if lower than current)
Returns
The ID of the created Audio object

Definition at line 739 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PlayMusic() [5/5]

static int Hellmade.Sound.EazySoundManager.PlayMusic ( AudioClip clip,
float volume,
bool loop,
bool persist,
float fadeInSeconds,
float fadeOutSeconds,
float currentMusicfadeOutSeconds,
Transform sourceTransform )
inlinestatic

Play background music.

Parameters
clipThe audio clip to play
volumeThe volume the music will have
loopWether the music is looped
persistWhether the audio persists in between scene changes
fadeInSecondsHow many seconds it needs for the audio to fade in/ reach target volume (if higher than current)
fadeOutSecondsHow many seconds it needs for the audio to fade out/ reach target volume (if lower than current)
currentMusicfadeOutSecondsHow many seconds it needs for current music audio to fade out. It will override its own fade out seconds. If -1 is passed, current music will keep its own fade out seconds
sourceTransformThe transform that is the source of the music (will become 3D audio). If 3D audio is not wanted, use null
Returns
The ID of the created Audio object

Definition at line 758 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PlaySound() [1/5]

static int Hellmade.Sound.EazySoundManager.PlaySound ( AudioClip clip,
string name )
inlinestatic

Definition at line 765 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PlaySound() [2/5]

static int Hellmade.Sound.EazySoundManager.PlaySound ( AudioClip clip,
string name,
bool loop )
inlinestatic

Play a sound fx.

Parameters
clipThe audio clip to play
loopWether the sound is looped
Returns
The ID of the created Audio object

Definition at line 781 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PlaySound() [3/5]

static int Hellmade.Sound.EazySoundManager.PlaySound ( AudioClip clip,
string name,
float volume )
inlinestatic

Definition at line 770 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PlaySound() [4/5]

static int Hellmade.Sound.EazySoundManager.PlaySound ( AudioClip clip,
string name,
float volume,
bool loop )
inlinestatic

Definition at line 786 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PlaySound() [5/5]

static int Hellmade.Sound.EazySoundManager.PlaySound ( AudioClip clip,
string name,
float volume,
bool loop,
Transform sourceTransform )
inlinestatic

Play a sound fx.

Parameters
clipThe audio clip to play
volumeThe volume the music will have
loopWether the sound is looped
sourceTransformThe transform that is the source of the sound (will become 3D audio). If 3D audio is not wanted, use null
Returns
The ID of the created Audio object

Definition at line 799 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PlayUISound() [1/2]

static int Hellmade.Sound.EazySoundManager.PlayUISound ( AudioClip clip)
inlinestatic

Play a UI sound fx.

Parameters
clipThe audio clip to play
Returns
The ID of the created Audio object

Definition at line 809 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PlayUISound() [2/2]

static int Hellmade.Sound.EazySoundManager.PlayUISound ( AudioClip clip,
float volume )
inlinestatic

Play a UI sound fx.

Parameters
clipThe audio clip to play
volumeThe volume the music will have
Returns
The ID of the created Audio object

Definition at line 820 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PrepareAudio() [1/2]

static int Hellmade.Sound.EazySoundManager.PrepareAudio ( Audio::AudioType audioType,
AudioClip clip,
float volume,
bool loop,
bool persist,
float fadeInSeconds,
float fadeOutSeconds,
float currentMusicfadeOutSeconds,
Transform sourceTransform )
inlinestaticprivate

Definition at line 660 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PrepareAudio() [2/2]

static int Hellmade.Sound.EazySoundManager.PrepareAudio ( string name,
Audio::AudioType audioType,
AudioClip clip,
float volume,
bool loop,
bool persist,
float fadeInSeconds,
float fadeOutSeconds,
float currentMusicfadeOutSeconds,
Transform sourceTransform )
inlinestaticprivate

Definition at line 629 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrepareMusic() [1/5]

static int Hellmade.Sound.EazySoundManager.PrepareMusic ( AudioClip clip)
inlinestatic

Prepares and initializes background music.

Parameters
clipThe audio clip to prepare
Returns
The ID of the created Audio object

Definition at line 498 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PrepareMusic() [2/5]

static int Hellmade.Sound.EazySoundManager.PrepareMusic ( AudioClip clip,
float volume )
inlinestatic

Prepares and initializes background music.

Parameters
clipThe audio clip to prepare
volumeThe volume the music will have
Returns
The ID of the created Audio object

Definition at line 509 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PrepareMusic() [3/5]

static int Hellmade.Sound.EazySoundManager.PrepareMusic ( AudioClip clip,
float volume,
bool loop,
bool persist )
inlinestatic

Prepares and initializes background music.

Parameters
clipThe audio clip to prepare
volumeThe volume the music will have
loopWether the music is looped
persistWhether the audio persists in between scene changes
Returns
The ID of the created Audio object

Definition at line 522 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PrepareMusic() [4/5]

static int Hellmade.Sound.EazySoundManager.PrepareMusic ( AudioClip clip,
float volume,
bool loop,
bool persist,
float fadeInSeconds,
float fadeOutSeconds )
inlinestatic

Prerpares and initializes background music.

Parameters
clipThe audio clip to prepare
volumeThe volume the music will have
loopWether the music is looped
persistWhether the audio persists in between scene changes
fadeInValueHow many seconds it needs for the audio to fade in/ reach target volume (if higher than current)
fadeOutValueHow many seconds it needs for the audio to fade out/ reach target volume (if lower than current)
Returns
The ID of the created Audio object

Definition at line 537 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PrepareMusic() [5/5]

static int Hellmade.Sound.EazySoundManager.PrepareMusic ( AudioClip clip,
float volume,
bool loop,
bool persist,
float fadeInSeconds,
float fadeOutSeconds,
float currentMusicfadeOutSeconds,
Transform sourceTransform )
inlinestatic

Prepares and initializes background music.

Parameters
clipThe audio clip to prepare
volumeThe volume the music will have
loopWether the music is looped
persistWhether the audio persists in between scene changes
fadeInValueHow many seconds it needs for the audio to fade in/ reach target volume (if higher than current)
fadeOutValueHow many seconds it needs for the audio to fade out/ reach target volume (if lower than current)
currentMusicfadeOutSecondsHow many seconds it needs for current music audio to fade out. It will override its own fade out seconds. If -1 is passed, current music will keep its own fade out seconds
sourceTransformThe transform that is the source of the music (will become 3D audio). If 3D audio is not wanted, use null
Returns
The ID of the created Audio object

Definition at line 556 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PrepareSound() [1/4]

static int Hellmade.Sound.EazySoundManager.PrepareSound ( AudioClip clip,
string name )
inlinestatic

Prepares and initializes a sound fx.

Parameters
clipThe audio clip to prepare
Returns
The ID of the created Audio object

Definition at line 568 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PrepareSound() [2/4]

static int Hellmade.Sound.EazySoundManager.PrepareSound ( AudioClip clip,
string name,
bool loop )
inlinestatic

Prepares and initializes a sound fx.

Parameters
clipThe audio clip to prepare
loopWether the sound is looped
Returns
The ID of the created Audio object

Definition at line 590 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PrepareSound() [3/4]

static int Hellmade.Sound.EazySoundManager.PrepareSound ( AudioClip clip,
string name,
float volume )
inlinestatic

Prepares and initializes a sound fx.

Parameters
clipThe audio clip to prepare
volumeThe volume the music will have
Returns
The ID of the created Audio object

Definition at line 579 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PrepareSound() [4/4]

static int Hellmade.Sound.EazySoundManager.PrepareSound ( AudioClip clip,
string name,
float volume,
bool loop,
Transform sourceTransform )
inlinestatic

Prepares and initializes a sound fx.

Parameters
clipThe audio clip to prepare
volumeThe volume the music will have
loopWether the sound is looped
sourceTransformThe transform that is the source of the sound (will become 3D audio). If 3D audio is not wanted, use null
Returns
The ID of the created Audio object

Definition at line 603 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PrepareUISound() [1/2]

static int Hellmade.Sound.EazySoundManager.PrepareUISound ( AudioClip clip,
string name )
inlinestatic

Prepares and initializes a UI sound fx.

Parameters
clipThe audio clip to prepare
Returns
The ID of the created Audio object

Definition at line 613 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ PrepareUISound() [2/2]

static int Hellmade.Sound.EazySoundManager.PrepareUISound ( AudioClip clip,
string name,
float volume )
inlinestatic

Prepares and initializes a UI sound fx.

Parameters
clipThe audio clip to prepare
volumeThe volume the music will have
Returns
The ID of the created Audio object

Definition at line 624 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ RemoveNonPersistAudio()

static void Hellmade.Sound.EazySoundManager.RemoveNonPersistAudio ( Dictionary< int, Audio > audioDict)
inlinestaticprivate

Remove all non-persistant audios from an audio dictionary.

Parameters
audioDictThe audio dictionary whose non-persistant audios are getting removed

Definition at line 224 of file EazySoundManager.cs.

Here is the caller graph for this function:

◆ RestoreAudioFromPool()

static bool Hellmade.Sound.EazySoundManager.RestoreAudioFromPool ( Audio::AudioType audioType,
int audioID )
inlinestatic

Restores and re-adds a pooled audio to its corresponding audio dictionary.

Parameters
audioTypeThe audio type of the audio to restore
audioIDThe ID of the audio to be restored
Returns
True if the audio is restored, false if the audio was not in the audio pool.

Definition at line 256 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResumeAll()

static void Hellmade.Sound.EazySoundManager.ResumeAll ( )
inlinestatic

Resume all audio playing.

Definition at line 989 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ ResumeAllAudio()

static void Hellmade.Sound.EazySoundManager.ResumeAllAudio ( Audio::AudioType audioType)
inlinestaticprivate

Definition at line 1020 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResumeAllMusic()

static void Hellmade.Sound.EazySoundManager.ResumeAllMusic ( )
inlinestatic

Resume all music playing.

Definition at line 999 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResumeAllSounds()

static void Hellmade.Sound.EazySoundManager.ResumeAllSounds ( )
inlinestatic

Resume all sound fx playing.

Definition at line 1007 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResumeAllUISounds()

static void Hellmade.Sound.EazySoundManager.ResumeAllUISounds ( )
inlinestatic

Resume all UI sound fx playing.

Definition at line 1015 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StopAll() [1/2]

static void Hellmade.Sound.EazySoundManager.StopAll ( )
inlinestatic

Stop all audio playing.

Definition at line 866 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StopAll() [2/2]

static void Hellmade.Sound.EazySoundManager.StopAll ( float musicFadeOutSeconds)
inlinestatic

Stop all audio playing.

Parameters
musicFadeOutSecondsHow many seconds it needs for all music audio to fade out. It will override their own fade out seconds. If -1 is passed, all music will keep their own fade out seconds

Definition at line 875 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ StopAllAudio()

static void Hellmade.Sound.EazySoundManager.StopAllAudio ( Audio::AudioType audioType,
float fadeOutSeconds )
inlinestaticprivate

Definition at line 915 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StopAllMusic() [1/2]

static void Hellmade.Sound.EazySoundManager.StopAllMusic ( )
inlinestatic

Stop all music playing.

Definition at line 885 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StopAllMusic() [2/2]

static void Hellmade.Sound.EazySoundManager.StopAllMusic ( float fadeOutSeconds)
inlinestatic

Stop all music playing.

Parameters
fadeOutSecondsHow many seconds it needs for all music audio to fade out. It will override their own fade out seconds. If -1 is passed, all music will keep their own fade out seconds

Definition at line 894 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ StopAllSounds()

static void Hellmade.Sound.EazySoundManager.StopAllSounds ( )
inlinestatic

Stop all sound fx playing.

Definition at line 902 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StopAllUISounds()

static void Hellmade.Sound.EazySoundManager.StopAllUISounds ( )
inlinestatic

Stop all UI sound fx playing.

Definition at line 910 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Update()

void Hellmade.Sound.EazySoundManager.Update ( )
inlineprivate

Definition at line 140 of file EazySoundManager.cs.

Here is the call graph for this function:

◆ UpdateAllAudio()

static void Hellmade.Sound.EazySoundManager.UpdateAllAudio ( Dictionary< int, Audio > audioDict)
inlinestaticprivate

Updates the state of all audios of an audio dictionary.

Parameters
audioDictThe audio dictionary to update

Definition at line 195 of file EazySoundManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ audioPool

Dictionary<int, Audio> Hellmade.Sound.EazySoundManager.audioPool
staticprivate

Definition at line 62 of file EazySoundManager.cs.

◆ initialized

bool Hellmade.Sound.EazySoundManager.initialized = false
staticprivate

Definition at line 66 of file EazySoundManager.cs.

◆ instance

EazySoundManager Hellmade.Sound.EazySoundManager.instance = null
staticprivate

Definition at line 57 of file EazySoundManager.cs.

◆ musicAudio

Dictionary<int, Audio> Hellmade.Sound.EazySoundManager.musicAudio
staticprivate

Definition at line 59 of file EazySoundManager.cs.

◆ soundsAudio

Dictionary<int, Audio> Hellmade.Sound.EazySoundManager.soundsAudio
staticprivate

Definition at line 60 of file EazySoundManager.cs.

◆ UISoundsAudio

Dictionary<int, Audio> Hellmade.Sound.EazySoundManager.UISoundsAudio
staticprivate

Definition at line 61 of file EazySoundManager.cs.

Property Documentation

◆ Gameobject

GameObject Hellmade.Sound.EazySoundManager.Gameobject
staticget

The gameobject that the sound manager is attached to.

Definition at line 17 of file EazySoundManager.cs.

◆ GlobalMusicVolume

float Hellmade.Sound.EazySoundManager.GlobalMusicVolume
staticgetset

Global music volume.

Definition at line 45 of file EazySoundManager.cs.

◆ GlobalSoundsVolume

float Hellmade.Sound.EazySoundManager.GlobalSoundsVolume
staticgetset

Global sounds volume.

Definition at line 50 of file EazySoundManager.cs.

◆ GlobalUISoundsVolume

float Hellmade.Sound.EazySoundManager.GlobalUISoundsVolume
staticgetset

Global UI sounds volume.

Definition at line 55 of file EazySoundManager.cs.

◆ GlobalVolume

float Hellmade.Sound.EazySoundManager.GlobalVolume
staticgetset

Global volume.

Definition at line 40 of file EazySoundManager.cs.

◆ IgnoreDuplicateMusic

bool Hellmade.Sound.EazySoundManager.IgnoreDuplicateMusic
staticgetset

When set to true, new music audios that have the same audio clip as any other music audios, will be ignored.

Definition at line 25 of file EazySoundManager.cs.

◆ IgnoreDuplicateSounds

bool Hellmade.Sound.EazySoundManager.IgnoreDuplicateSounds
staticgetset

When set to true, new sound audios that have the same audio clip as any other sound audios, will be ignored.

Definition at line 30 of file EazySoundManager.cs.

◆ IgnoreDuplicateUISounds

bool Hellmade.Sound.EazySoundManager.IgnoreDuplicateUISounds
staticgetset

When set to true, new UI sound audios that have the same audio clip as any other UI sound audios, will be ignored.

Definition at line 35 of file EazySoundManager.cs.

◆ Instance

EazySoundManager Hellmade.Sound.EazySoundManager.Instance
staticgetprivate

Definition at line 68 of file EazySoundManager.cs.

Event Documentation

◆ AudioStopped

Action<Audio> Hellmade.Sound.EazySoundManager.AudioStopped
static

Definition at line 64 of file EazySoundManager.cs.


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