This persistent singleton handles sound playing.
More...
|
| virtual void | PlayBackgroundMusic (AudioSource Music) |
| | Plays a background music. Only one background music can be active at a time.
|
| virtual AudioSource | PlaySound (AudioClip sfx, Vector3 location, bool loop=false) |
| | Plays a sound.
|
| virtual AudioSource | PlaySound (AudioClip sfx, Vector3 location, float pitch, float pan, float spatialBlend=0.0f, float volumeMultiplier=1.0f, bool loop=false, AudioSource reuseSource=null, AudioMixerGroup audioGroup=null) |
| | Advanced PlaySound method.
|
| virtual void | StopLoopingSound (AudioSource source) |
| | Stops the looping sounds if there are any.
|
| virtual void | MusicOn () |
| | Sets the music setting to On.
|
| virtual void | MusicOff () |
| | Sets the Music setting to Off.
|
| virtual void | SfxOn () |
| | Sets the SFX setting to On.
|
| virtual void | SfxOff () |
| | Sets the SFX setting to Off.
|
| virtual void | OnMMSfxEvent (AudioClip clipToPlay, AudioMixerGroup audioGroup=null, float volume=1f, float pitch=1f, int priority=128) |
| | When we grab a sfx event, we play the corresponding sound.
|
| virtual void | OnMMEvent (MMGameEvent gameEvent) |
| | Watches for game events to mute sfx if needed.
|
| virtual void | OnMMEvent (CorgiEngineEvent engineEvent) |
| | Watches for pause events to cut the sound on pause.
|
| virtual void | UnmuteBackgroundMusic () |
| | Unmutes the background music.
|
| virtual void | MuteBackgroundMusic () |
| | Mutes the background music.
|
| void | OnMMEvent (T eventType) |
|
| virtual void | SetMusic (bool status) |
| | Sets the music on/off setting based on the value in parameters This value will be saved, and any music played after that setting change will comply.
|
| virtual void | SetSfx (bool status) |
| | Sets the SFX on/off setting based on the value in parameters This value will be saved, and any SFX played after that setting change will comply.
|
| virtual void | SaveSoundSettings () |
| | Saves the sound settings to file.
|
| virtual void | LoadSoundSettings () |
| | Loads the sound settings from file (if found)
|
| virtual void | ResetSoundSettings () |
| | Resets the sound settings by destroying the save file.
|
| virtual void | MuteAllSfx () |
| | Mutes all sfx currently playing.
|
| virtual void | UnmuteAllSfx () |
| | Unmutes all sfx currently playing.
|
| virtual void | OnEnable () |
| | On enable we start listening for events.
|
| virtual void | OnDisable () |
| | On disable we stop listening for events.
|
| virtual void | Awake () |
| | On awake, we check if there's already a copy of the object in the scene. If there's one, we destroy it.
|
| virtual void | InitializeSingleton () |
| | Initializes the singleton.
|
This persistent singleton handles sound playing.
◆ InitializeStatics()
| void MoreMountains.CorgiEngine.SoundManager.InitializeStatics |
( |
| ) |
|
|
staticprotected |
Statics initialization to support enter play modes.
◆ LoadSoundSettings()
| virtual void MoreMountains.CorgiEngine.SoundManager.LoadSoundSettings |
( |
| ) |
|
|
protectedvirtual |
Loads the sound settings from file (if found)
◆ MusicOff()
| virtual void MoreMountains.CorgiEngine.SoundManager.MusicOff |
( |
| ) |
|
|
virtual |
Sets the Music setting to Off.
◆ MusicOn()
| virtual void MoreMountains.CorgiEngine.SoundManager.MusicOn |
( |
| ) |
|
|
virtual |
Sets the music setting to On.
◆ MuteAllSfx()
| virtual void MoreMountains.CorgiEngine.SoundManager.MuteAllSfx |
( |
| ) |
|
|
protectedvirtual |
Mutes all sfx currently playing.
◆ MuteBackgroundMusic()
| virtual void MoreMountains.CorgiEngine.SoundManager.MuteBackgroundMusic |
( |
| ) |
|
|
virtual |
Mutes the background music.
◆ OnDisable()
| virtual void MoreMountains.CorgiEngine.SoundManager.OnDisable |
( |
| ) |
|
|
protectedvirtual |
On disable we stop listening for events.
◆ OnEnable()
| virtual void MoreMountains.CorgiEngine.SoundManager.OnEnable |
( |
| ) |
|
|
protectedvirtual |
On enable we start listening for events.
◆ OnMMEvent() [1/2]
| virtual void MoreMountains.CorgiEngine.SoundManager.OnMMEvent |
( |
CorgiEngineEvent | engineEvent | ) |
|
|
virtual |
Watches for pause events to cut the sound on pause.
- Parameters
-
◆ OnMMEvent() [2/2]
| virtual void MoreMountains.CorgiEngine.SoundManager.OnMMEvent |
( |
MMGameEvent | gameEvent | ) |
|
|
virtual |
Watches for game events to mute sfx if needed.
- Parameters
-
◆ OnMMSfxEvent()
| virtual void MoreMountains.CorgiEngine.SoundManager.OnMMSfxEvent |
( |
AudioClip | clipToPlay, |
|
|
AudioMixerGroup | audioGroup = null, |
|
|
float | volume = 1f, |
|
|
float | pitch = 1f, |
|
|
int | priority = 128 ) |
|
virtual |
When we grab a sfx event, we play the corresponding sound.
- Parameters
-
◆ PlayBackgroundMusic()
| virtual void MoreMountains.CorgiEngine.SoundManager.PlayBackgroundMusic |
( |
AudioSource | Music | ) |
|
|
virtual |
Plays a background music. Only one background music can be active at a time.
- Parameters
-
◆ PlaySound() [1/2]
| virtual AudioSource MoreMountains.CorgiEngine.SoundManager.PlaySound |
( |
AudioClip | sfx, |
|
|
Vector3 | location, |
|
|
bool | loop = false ) |
|
virtual |
Plays a sound.
- Returns
- An audiosource
- Parameters
-
| sfx | The sound clip you want to play. |
| location | The location of the sound. |
| loop | If set to true, the sound will loop. |
◆ PlaySound() [2/2]
| virtual AudioSource MoreMountains.CorgiEngine.SoundManager.PlaySound |
( |
AudioClip | sfx, |
|
|
Vector3 | location, |
|
|
float | pitch, |
|
|
float | pan, |
|
|
float | spatialBlend = 0::0f, |
|
|
float | volumeMultiplier = 1::0f, |
|
|
bool | loop = false, |
|
|
AudioSource | reuseSource = null, |
|
|
AudioMixerGroup | audioGroup = null ) |
|
virtual |
Advanced PlaySound method.
- Parameters
-
| sfx | |
| location | |
| pitch | |
| pan | |
| spatialBlend | |
| volumeMultiplier | |
| loop | |
| reuseSource | |
| audioGroup | |
| soundFadeInDuration | |
- Returns
◆ ResetSoundSettings()
| virtual void MoreMountains.CorgiEngine.SoundManager.ResetSoundSettings |
( |
| ) |
|
|
protectedvirtual |
Resets the sound settings by destroying the save file.
◆ SaveSoundSettings()
| virtual void MoreMountains.CorgiEngine.SoundManager.SaveSoundSettings |
( |
| ) |
|
|
protectedvirtual |
Saves the sound settings to file.
◆ SetMusic()
| virtual void MoreMountains.CorgiEngine.SoundManager.SetMusic |
( |
bool | status | ) |
|
|
protectedvirtual |
Sets the music on/off setting based on the value in parameters This value will be saved, and any music played after that setting change will comply.
- Parameters
-
◆ SetSfx()
| virtual void MoreMountains.CorgiEngine.SoundManager.SetSfx |
( |
bool | status | ) |
|
|
protectedvirtual |
Sets the SFX on/off setting based on the value in parameters This value will be saved, and any SFX played after that setting change will comply.
- Parameters
-
◆ SfxOff()
| virtual void MoreMountains.CorgiEngine.SoundManager.SfxOff |
( |
| ) |
|
|
virtual |
Sets the SFX setting to Off.
◆ SfxOn()
| virtual void MoreMountains.CorgiEngine.SoundManager.SfxOn |
( |
| ) |
|
|
virtual |
Sets the SFX setting to On.
◆ StopLoopingSound()
| virtual void MoreMountains.CorgiEngine.SoundManager.StopLoopingSound |
( |
AudioSource | source | ) |
|
|
virtual |
Stops the looping sounds if there are any.
- Parameters
-
◆ UnmuteAllSfx()
| virtual void MoreMountains.CorgiEngine.SoundManager.UnmuteAllSfx |
( |
| ) |
|
|
protectedvirtual |
Unmutes all sfx currently playing.
◆ UnmuteBackgroundMusic()
| virtual void MoreMountains.CorgiEngine.SoundManager.UnmuteBackgroundMusic |
( |
| ) |
|
|
virtual |
Unmutes the background music.
◆ _backgroundMusic
| AudioSource MoreMountains.CorgiEngine.SoundManager._backgroundMusic |
|
protected |
◆ _loopingSounds
| List<AudioSource> MoreMountains.CorgiEngine.SoundManager._loopingSounds |
|
protected |
◆ _saveFileName
| const string MoreMountains.CorgiEngine.SoundManager._saveFileName = "sound.settings" |
|
staticprotected |
◆ _saveFolderName
| const string MoreMountains.CorgiEngine.SoundManager._saveFolderName = "CorgiEngine/" |
|
staticprotected |
◆ MusicVolume
| float MoreMountains.CorgiEngine.SoundManager.MusicVolume =0.3f |
◆ MuteSfxOnPause
| bool MoreMountains.CorgiEngine.SoundManager.MuteSfxOnPause = true |
whether or not to mute sfx when pausing the game
◆ Settings
the sound settings to use for this manager
◆ SfxVolume
| float MoreMountains.CorgiEngine.SoundManager.SfxVolume =1f |
The documentation for this class was generated from the following file: