Click or drag to resize

AudioManager Class

Allows to play & pool sounds and group them into AudioSources. Handles background music.
Inheritance Hierarchy
SystemObject
  KitAudioManager

Namespace:  Kit
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0
Syntax
C#
public static class AudioManager
Request Example View Source

The AudioManager type exposes the following members.

Properties
  NameDescription
Public propertyStatic memberIsMusicPlaying
Returns whether a background music is playing.
Public propertyStatic memberMusicFadeSpeed
Gets or sets how fast to fade the background music.
Public propertyStatic memberMusicManager
Handler for music since we're always fading it.
Public propertyStatic memberMusicSource
The AudioSource for background music.
Public propertyStatic memberSoundSource
The AudioSource for general sounds group.
Public propertyStatic memberUISource
The AudioSource for UI sounds group.
Top
Methods
  NameDescription
Public methodStatic memberCreateGroup
Create a new AudioSource for a sound group.
Public methodStatic memberGetAllGroups
Returns all AudioSources.
Public methodStatic memberGetGroup
Get the AudioSource for a group.
Public methodStatic memberGetOrCreateGroup
Get the AudioSource for a group and create a new one for it if it doesn't exist.
Public methodStatic memberInitialize
Initializes the manager and creates audio groups for general sounds, UI and music.
Public methodStatic memberLoadGroupVolume
Returns the volume saved in the settings for a group.
Public methodStatic memberPauseMusic
Pause the background music.
Public methodStatic memberPlay(AudioSource)
Spawn an AudioSource and pool it after the sound ends.
Public methodStatic memberPlay(String, AudioClip)
Play an audio with a group's AudioSource. Create the group if it doesn't exist.
Public methodStatic memberPlay(AudioSource, Vector3)
Spawn an AudioSource and pool it after the sound ends.
Public methodStatic memberPlay(AudioClip, Boolean, Boolean)
Play an audio with a dedicated AudioSource and destroy it after it ends (if it's not looping).
Public methodStatic memberPlay(AudioSource, Transform, Boolean)
Spawn an AudioSource and pool it after the sound ends.
Public methodStatic memberPlay(AudioSource, Transform, Vector3)
Spawn an AudioSource and pool it after the sound ends.
Public methodStatic memberPlay(AudioClip, Transform, Boolean, Boolean)
Play an audio with a dedicated AudioSource and destroy it after it ends (if it's not looping).
Public methodStatic memberPlay(AudioClip, Vector3, Boolean, Boolean)
Play an audio with a dedicated AudioSource and destroy it after it ends (if it's not looping).
Public methodStatic memberPlay(AudioClip, Transform, Vector3, Boolean, Boolean)
Play an audio with a dedicated AudioSource and destroy it after it ends (if it's not looping).
Public methodStatic memberPlayMusic
Play the background music.
Public methodStatic memberPlayMusic(AudioClip)
Set and play background music.
Public methodStatic memberPlaySound(IReadOnlyListAudioClip)
Play a random audio from a list.
Public methodStatic memberPlaySound(AudioClip)
Play an audio with the general sounds group.
Public methodStatic memberPlayUI
Play an audio with the UI sounds group.
Public methodStatic memberRemoveGroup
Destroy the AudioSource for a group.
Public methodStatic memberSaveGroupVolume(String)
Saves the current volume of a group in settings.
Public methodStatic memberSaveGroupVolume(String, Single)
Saves the volume of a group in settings.
Public methodStatic memberStopMusic
Stop the background music.
Top
Fields
  NameDescription
Public fieldStatic memberDefaultMusicVolume
Default volume level to use for the background music.
Public fieldStatic memberMusicGroup
The group name to use for background music.
Public fieldStatic memberSoundGroup
The group name to use for general sounds.
Public fieldStatic memberUIGroup
The group name to use for UI sounds.
Top
See Also

Reference