OLD_STEP_LIST_EDITOR |
Documentation for the Unity C# Library
|
Static class responsible for playing and managing audio and sounds. More...
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< Audio > | AudioStopped |
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, Audio > | GetAudioTypeDictionary (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, Audio > | audioPool |
static bool | initialized = false |
static EazySoundManager | instance = null |
static Dictionary< int, Audio > | musicAudio |
static Dictionary< int, Audio > | soundsAudio |
static Dictionary< int, Audio > | UISoundsAudio |
Static class responsible for playing and managing audio and sounds.
Definition at line 12 of file EazySoundManager.cs.
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlinestatic |
Returns the first occurrence of Audio that plays the given audioClip. Returns null if no such Audio is found.
audioClip | The audio clip of the Audio to be retrieved |
Definition at line 332 of file EazySoundManager.cs.
|
inlinestatic |
Returns the Audio that has as its id the audioID if one is found, returns null if no such Audio is found.
audioID | The id of the Audio to be retrieved |
Definition at line 277 of file EazySoundManager.cs.
|
inlinestatic |
|
inlinestaticprivate |
Retrieves the audio dictionary based on the audioType.
audioType | The audio type of the dictionary to return |
Definition at line 152 of file EazySoundManager.cs.
|
inlinestaticprivate |
Retrieves the IgnoreDuplicates setting of audios of a specified audio type.
audioType | The audio type that the returned IgnoreDuplicates setting affects |
Definition at line 176 of file EazySoundManager.cs.
|
inlinestatic |
Returns the first occurrence of music Audio that plays the given audioClip. Returns null if no such Audio is found.
audioClip | The audio clip of the music Audio to be retrieved |
Definition at line 370 of file EazySoundManager.cs.
|
inlinestatic |
Returns the music Audio that has as its id the audioID if one is found, returns null if no such Audio is found.
audioID | The id of the music Audio to be returned |
Definition at line 360 of file EazySoundManager.cs.
|
inlinestatic |
|
inlinestatic |
Returns the first occurrence of sound Audio that plays the given audioClip. Returns null if no such Audio is found.
audioClip | The audio clip of the sound Audio to be retrieved |
Definition at line 405 of file EazySoundManager.cs.
|
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.
audioID | The id of the sound fx Audio to be returned |
Definition at line 380 of file EazySoundManager.cs.
|
inlinestatic |
|
inlinestatic |
Returns the first occurrence of UI sound Audio that plays the given audioClip. Returns null if no such Audio is found.
audioClip | The audio clip of the UI sound Audio to be retrieved |
Definition at line 425 of file EazySoundManager.cs.
|
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.
audioID | The id of the UI sound fx Audio to be returned |
Definition at line 415 of file EazySoundManager.cs.
|
inlinestatic |
Definition at line 395 of file EazySoundManager.cs.
|
inlineprivate |
Initialized the sound manager.
Definition at line 94 of file EazySoundManager.cs.
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
Event triggered when a new scene is loaded.
scene | The scene that is loaded |
mode | The scene load mode |
Definition at line 132 of file EazySoundManager.cs.
|
inlinestatic |
Pause all audio playing.
Definition at line 939 of file EazySoundManager.cs.
|
inlinestaticprivate |
Definition at line 970 of file EazySoundManager.cs.
|
inlinestatic |
Pause all music playing.
Definition at line 949 of file EazySoundManager.cs.
|
inlinestatic |
Pause all sound fx playing.
Definition at line 957 of file EazySoundManager.cs.
|
inlinestatic |
Pause all UI sound fx playing.
Definition at line 965 of file EazySoundManager.cs.
|
inlinestaticprivate |
Definition at line 825 of file EazySoundManager.cs.
|
inlinestaticprivate |
|
inlinestatic |
Play background music.
clip | The audio clip to play |
Definition at line 700 of file EazySoundManager.cs.
|
inlinestatic |
Play background music.
clip | The audio clip to play |
volume | The volume the music will have |
Definition at line 711 of file EazySoundManager.cs.
|
inlinestatic |
Play background music.
clip | The audio clip to play |
volume | The volume the music will have |
loop | Wether the music is looped |
persist | Whether the audio persists in between scene changes |
Definition at line 724 of file EazySoundManager.cs.
|
inlinestatic |
Play background music.
clip | The audio clip to play |
volume | The volume the music will have |
loop | Wether the music is looped |
persist | Whether the audio persists in between scene changes |
fadeInSeconds | How many seconds it needs for the audio to fade in/ reach target volume (if higher than current) |
fadeOutSeconds | How many seconds it needs for the audio to fade out/ reach target volume (if lower than current) |
Definition at line 739 of file EazySoundManager.cs.
|
inlinestatic |
Play background music.
clip | The audio clip to play |
volume | The volume the music will have |
loop | Wether the music is looped |
persist | Whether the audio persists in between scene changes |
fadeInSeconds | How many seconds it needs for the audio to fade in/ reach target volume (if higher than current) |
fadeOutSeconds | How many seconds it needs for the audio to fade out/ reach target volume (if lower than current) |
currentMusicfadeOutSeconds | How 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 |
sourceTransform | The transform that is the source of the music (will become 3D audio). If 3D audio is not wanted, use null |
Definition at line 758 of file EazySoundManager.cs.
|
inlinestatic |
Definition at line 765 of file EazySoundManager.cs.
|
inlinestatic |
Play a sound fx.
clip | The audio clip to play |
loop | Wether the sound is looped |
Definition at line 781 of file EazySoundManager.cs.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Play a sound fx.
clip | The audio clip to play |
volume | The volume the music will have |
loop | Wether the sound is looped |
sourceTransform | The transform that is the source of the sound (will become 3D audio). If 3D audio is not wanted, use null |
Definition at line 799 of file EazySoundManager.cs.
|
inlinestatic |
Play a UI sound fx.
clip | The audio clip to play |
Definition at line 809 of file EazySoundManager.cs.
|
inlinestatic |
Play a UI sound fx.
clip | The audio clip to play |
volume | The volume the music will have |
Definition at line 820 of file EazySoundManager.cs.
|
inlinestaticprivate |
|
inlinestaticprivate |
Definition at line 629 of file EazySoundManager.cs.
|
inlinestatic |
Prepares and initializes background music.
clip | The audio clip to prepare |
Definition at line 498 of file EazySoundManager.cs.
|
inlinestatic |
Prepares and initializes background music.
clip | The audio clip to prepare |
volume | The volume the music will have |
Definition at line 509 of file EazySoundManager.cs.
|
inlinestatic |
Prepares and initializes background music.
clip | The audio clip to prepare |
volume | The volume the music will have |
loop | Wether the music is looped |
persist | Whether the audio persists in between scene changes |
Definition at line 522 of file EazySoundManager.cs.
|
inlinestatic |
Prerpares and initializes background music.
clip | The audio clip to prepare |
volume | The volume the music will have |
loop | Wether the music is looped |
persist | Whether the audio persists in between scene changes |
fadeInValue | How many seconds it needs for the audio to fade in/ reach target volume (if higher than current) |
fadeOutValue | How many seconds it needs for the audio to fade out/ reach target volume (if lower than current) |
Definition at line 537 of file EazySoundManager.cs.
|
inlinestatic |
Prepares and initializes background music.
clip | The audio clip to prepare |
volume | The volume the music will have |
loop | Wether the music is looped |
persist | Whether the audio persists in between scene changes |
fadeInValue | How many seconds it needs for the audio to fade in/ reach target volume (if higher than current) |
fadeOutValue | How many seconds it needs for the audio to fade out/ reach target volume (if lower than current) |
currentMusicfadeOutSeconds | How 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 |
sourceTransform | The transform that is the source of the music (will become 3D audio). If 3D audio is not wanted, use null |
Definition at line 556 of file EazySoundManager.cs.
|
inlinestatic |
Prepares and initializes a sound fx.
clip | The audio clip to prepare |
Definition at line 568 of file EazySoundManager.cs.
|
inlinestatic |
Prepares and initializes a sound fx.
clip | The audio clip to prepare |
loop | Wether the sound is looped |
Definition at line 590 of file EazySoundManager.cs.
|
inlinestatic |
Prepares and initializes a sound fx.
clip | The audio clip to prepare |
volume | The volume the music will have |
Definition at line 579 of file EazySoundManager.cs.
|
inlinestatic |
Prepares and initializes a sound fx.
clip | The audio clip to prepare |
volume | The volume the music will have |
loop | Wether the sound is looped |
sourceTransform | The transform that is the source of the sound (will become 3D audio). If 3D audio is not wanted, use null |
Definition at line 603 of file EazySoundManager.cs.
|
inlinestatic |
Prepares and initializes a UI sound fx.
clip | The audio clip to prepare |
Definition at line 613 of file EazySoundManager.cs.
|
inlinestatic |
Prepares and initializes a UI sound fx.
clip | The audio clip to prepare |
volume | The volume the music will have |
Definition at line 624 of file EazySoundManager.cs.
|
inlinestaticprivate |
Remove all non-persistant audios from an audio dictionary.
audioDict | The audio dictionary whose non-persistant audios are getting removed |
Definition at line 224 of file EazySoundManager.cs.
|
inlinestatic |
Restores and re-adds a pooled audio to its corresponding audio dictionary.
audioType | The audio type of the audio to restore |
audioID | The ID of the audio to be restored |
Definition at line 256 of file EazySoundManager.cs.
|
inlinestatic |
Resume all audio playing.
Definition at line 989 of file EazySoundManager.cs.
|
inlinestaticprivate |
Definition at line 1020 of file EazySoundManager.cs.
|
inlinestatic |
Resume all music playing.
Definition at line 999 of file EazySoundManager.cs.
|
inlinestatic |
Resume all sound fx playing.
Definition at line 1007 of file EazySoundManager.cs.
|
inlinestatic |
Resume all UI sound fx playing.
Definition at line 1015 of file EazySoundManager.cs.
|
inlinestatic |
Stop all audio playing.
Definition at line 866 of file EazySoundManager.cs.
|
inlinestatic |
Stop all audio playing.
musicFadeOutSeconds | How 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.
|
inlinestaticprivate |
Definition at line 915 of file EazySoundManager.cs.
|
inlinestatic |
Stop all music playing.
Definition at line 885 of file EazySoundManager.cs.
|
inlinestatic |
Stop all music playing.
fadeOutSeconds | How 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.
|
inlinestatic |
Stop all sound fx playing.
Definition at line 902 of file EazySoundManager.cs.
|
inlinestatic |
Stop all UI sound fx playing.
Definition at line 910 of file EazySoundManager.cs.
|
inlineprivate |
|
inlinestaticprivate |
Updates the state of all audios of an audio dictionary.
audioDict | The audio dictionary to update |
Definition at line 195 of file EazySoundManager.cs.
|
staticprivate |
Definition at line 62 of file EazySoundManager.cs.
|
staticprivate |
Definition at line 66 of file EazySoundManager.cs.
|
staticprivate |
Definition at line 57 of file EazySoundManager.cs.
|
staticprivate |
Definition at line 59 of file EazySoundManager.cs.
|
staticprivate |
Definition at line 60 of file EazySoundManager.cs.
|
staticprivate |
Definition at line 61 of file EazySoundManager.cs.
|
staticget |
The gameobject that the sound manager is attached to.
Definition at line 17 of file EazySoundManager.cs.
|
staticgetset |
Global music volume.
Definition at line 45 of file EazySoundManager.cs.
|
staticgetset |
Global sounds volume.
Definition at line 50 of file EazySoundManager.cs.
|
staticgetset |
Global UI sounds volume.
Definition at line 55 of file EazySoundManager.cs.
|
staticgetset |
Global volume.
Definition at line 40 of file EazySoundManager.cs.
|
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.
|
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.
|
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.
|
staticgetprivate |
Definition at line 68 of file EazySoundManager.cs.
|
static |
Definition at line 64 of file EazySoundManager.cs.