Learn / Documentation / Script Reference / SoundyController
Manual

SoundyController

class in Doozy.Engine.Soundy / Inherits from MonoBehaviour

Description

This is an audio controller used by the Soundy system to play sounds. Each sound has its own controller that handles it.

Every SoundyController is also added to the SoundyPooler to work seamlessly with the dynamic sound pooling system.
See Also: SoundyPooler

Properties

  • public AudioSource AudioSource – Target AudioSource component

  • public bool InUse – Keeps track if this controller is in use or idle

  • public float PlayProgress – Keeps track of the currently playing AudioClip play progress

  • public bool IsPaused – Keeps track if this controller is paused or not

  • public bool IsMuted – Keeps track if this controller is muted or not

  • public float LastPlayedTime – Keeps track of when was the last time this controller was used (info needed for the dynamic pooling system)

  • public float IdleDuration – Returns the duration since this controller has been used last

Public Methods

Static Methods

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

  • public static void KillAll() – Stops all controllers from playing and destroys the GameObject they are attached to

  • public static void MuteAll() – Mutes all the controllers

  • public static void PauseAll() – Pauses all the controllers that are currently playing

  • public static void RemoveNullControllersFromDatabase() – Removes any null controllers from the database

  • public static void StopAll() – Stops all the controllers that are currently playing

  • public static void UnmuteAll() – Unmute all the controllers that were previously muted

  • public static void UnpauseAll() – Unpause all the controllers that were previously paused