Learn / Documentation / Script Reference / SoundyManager

SoundyManager

class in Doozy.Engine.Soundy / Inherits from MonoBehaviour

Description

SoundyManager is the central component of the Soundy system that binds all the sound sub-systems together.

It gets the SoundGroupData references from the SoundyDatabase and passes them to the SoundyPooler, that in turn manages and uses SoundyControllers to play the sounds.

Static Properties

  • public static SoundyManager Instance – Returns a reference to the SoundyManager in the Scene. If one does not exist, it gets created

  • public static SoundyPooler  Pooler – Returns a reference to the SoundyPooler component on this GameObject. If one does not exist, it gets added

  • public static SoundyDatabase Database – Direct reference to the SoundyDatabase asset

Static Methods

  • public static SoundyManager AddToScene(bool selectGameObjectAfterCreation = false) – Adds SoundyManager to scene and returns a reference to it

  • public static SoundyController GetController() – Creates a new SoundyController in the current scene and returns a reference to it

  • public static string GetDatabaseFilename(string databaseName) – Returns a proper formatted filename for a given database name

  • public static void KillAllControllers() – Stops all SoundyControllers from playing and destroys the GameObjects they are attached to

  • public static void MuteAllControllers() – Mutes all the SoundyControllers

  • public static void MuteAllSounds() – Mute all sound sources (including MasterAudio)

  • public static void PauseAllControllers() – Pauses all the SoundyControllers that are currently playing

  •  public static void PauseAllSounds() – Pause all sound sources (including MasterAudio)

  • public static SoundyController Play(string databaseName, string soundName, Vector3 position) – Plays the specified sound with the given category, name and type, at the set position. Returns a reference to the SoundyController that is playing the sound. Returns null if no sound is found.

  • public static SoundyController Play(AudioClip audioClip, Vector3 position) – Plays the specified sound, at the set position. Returns a reference to the SoundyController that is playing the sound. Returns null if the AudioClip is null.

  • public static SoundyController Play(string databaseName, string soundName, Transform followTarget) – Plays the specified sound while following the follow target  transform while playing. Returns a reference to the SoundyController that is playing the sound. Returns null if no sound is found.

  • public static SoundyController Play(AudioClip audioClip, Transform followTarget) – Plays the specified sound, at the set position. Returns a reference to the SoundyController that is playing the sound. Returns null if the AudioClip is null.

  • public static SoundyController Play(string databaseName, string soundName) – Plays the specified sound with the given category, name and type. Returns a reference to the SoundyController that is playing the sound. Returns null if no sound is found.

  • public static SoundyController Play(AudioClip audioClip) – Plays the specified sound. Returns a reference to the SoundyController that is playing the sound. Returns null if the AudioClip is null.

  • public static SoundyController Play(AudioClip audioClip, AudioMixerGroup outputAudioMixerGroup, Vector3 position, float volume = 1, float pitch = 1, bool loop = false, float spatialBlend = 0) – Plays the specified audio clip with the given parameters, at the set position. Returns a reference to the SoundyController that is playing the sound. Returns null if the AudioClip is null.

  • public static SoundyController Play(AudioClip audioClip, AudioMixerGroup outputAudioMixerGroup, Transform followTarget = null, float volume = 1, float pitch = 1, bool loop = false, float spatialBlend = 0) – Plays the specified audio clip with the given parameters. Returns a reference to the SoundyController that is playing the sound. Returns null if the AudioClip is null.

  • public static SoundyController Play(SoundyData data) – Plays a sound according to the settings in the SoundyData reference. Returns a reference to the SoundyController that is playing the sound if data.SoundSource is set to either Soundy or AudioClip. If data is null or data.SoundSource is set to MasterAudio, it will always return null because MasterAudio is the one playing the sound and not a SoundyController

  • public static void StopAllControllers() – Stops all the SoundyControllers that are currently playing

  • public static void StopAllSounds() – Stop all sound sources (including MasterAudio)

  • public static void UnmuteAllControllers() – Unmute all the SoundyControllers that were previously muted

  • public static void UnmuteAllSounds() – Unmute all sound sources (including MasterAudio)

  • public static void UnpauseAllControllers() – Unpause all the SoundyControllers that were previously paused

  • public static void UnpauseAllSounds() – Unpause all sound sources (including MasterAudio)