Sequine - Scripting API
Calcatz.CookieCutter.Audio.AudioManager Class Reference
Inheritance diagram for Calcatz.CookieCutter.Audio.AudioManager:

Public Types

enum  Channel {
  Master , BGM , Ambience , ME ,
  SFX
}
 

Static Public Member Functions

static bool IsDestroyed ()
 
static void SetVolume (float _volumePercent, Channel _channel)
 Set volume of the selected channel. More...
 
static void AddAudioSourceInstance (AudioSourceAutoAdjustVolume _audioSource)
 
static void RemoveAudioSourceInstance (AudioSourceAutoAdjustVolume _audioSource)
 
static void PlayBGM (AudioClip _clip, bool _restart=true, float _fadeDuration=-1, float _volumeMultiplier=1f)
 Play music with given crossfade duration. More...
 
static void PlayBGM (string _id, bool _restart=true, float _fadeDuration=-1, float _volumeMultiplier=1f)
 Play music with given sound name/ID in SoundLibrary. More...
 
static AudioClip GetActiveBGM ()
 Return AudioClip of the currently/lastly played music. More...
 
static void StopBGM (float _fadeDuration=-1)
 Stop current music with given crossfade duration. More...
 
static void ResumeBGM (float _fadeDuration=-1)
 Resume the previously stopped BGM. More...
 
static void PlayAmbience (AudioClip _clip, bool _restart=true, float _fadeDuration=-1, float _volumeMultiplier=1f)
 Play ambience with given crossfade duration. More...
 
static void PlayAmbience (string _id, bool _restart=true, float _fadeDuration=-1, float _volumeMultiplier=1f)
 Play ambience with given sound name/ID in SoundLibrary. More...
 
static AudioClip GetActiveAmbience ()
 Return AudioClip of the currently/lastly played ambience. More...
 
static void StopAmbience (float _fadeDuration=-1)
 Stop current ambience with given crossfade duration. More...
 
static void ResumeAmbience (float _fadeDuration=-1)
 Resume the previously stopped ambience with given crossfade duration. More...
 
static AudioSource PlaySoundAtPosition (AudioClip _clip, Vector3 _position, float _volume=-1, System.Action _onComplete=null)
 Play 3D sound on the given position. More...
 
static AudioSource PlaySound2D (AudioClip _clip, float _volume=-1, System.Action _onComplete=null)
 Play 2D sound, ignoring the position of sound's source. More...
 
static void PlaySFXAtPosition (string _id, Vector3 _position, System.Action _onComplete=null, float _volumeMultiplier=1f)
 Play sound effect with given name/ID in SoundLibrary on the given position. More...
 
static void PlaySFX2D (string _id, System.Action _onComplete=null, float _volumeMultiplier=1f)
 Play 2D sound effect with given name/ID in SoundLibrary, ignoring the position of sound's source. More...
 
static void PlayMEAtPosition (string _id, Vector3 _position, System.Action _onComplete=null, float _volumeMultiplier=1f)
 Play music effect with given name/ID in SoundLibrary on the given position. More...
 
static void PlayME2D (string _id, System.Action _onComplete=null, float _volumeMultiplier=1f)
 Play 2D music effect with given name/ID in SoundLibrary, ignoring the position of sound's source. More...
 

Properties

static AudioManager Instance [get]
 

Member Enumeration Documentation

◆ Channel

Enumerator
Master 
BGM 
Ambience 
ME 
SFX 

Member Function Documentation

◆ AddAudioSourceInstance()

static void Calcatz.CookieCutter.Audio.AudioManager.AddAudioSourceInstance ( AudioSourceAutoAdjustVolume  _audioSource)
static

◆ GetActiveAmbience()

static AudioClip Calcatz.CookieCutter.Audio.AudioManager.GetActiveAmbience ( )
static

Return AudioClip of the currently/lastly played ambience.

Returns

◆ GetActiveBGM()

static AudioClip Calcatz.CookieCutter.Audio.AudioManager.GetActiveBGM ( )
static

Return AudioClip of the currently/lastly played music.

Returns

◆ IsDestroyed()

static bool Calcatz.CookieCutter.Audio.AudioManager.IsDestroyed ( )
static

◆ PlayAmbience() [1/2]

static void Calcatz.CookieCutter.Audio.AudioManager.PlayAmbience ( AudioClip  _clip,
bool  _restart = true,
float  _fadeDuration = -1,
float  _volumeMultiplier = 1f 
)
static

Play ambience with given crossfade duration.

Parameters
_clip
_restartRestart if the clip has already been played.
_fadeDurationSet to 0 to disable crossfade, and set to -1 to use default fade duration.

◆ PlayAmbience() [2/2]

static void Calcatz.CookieCutter.Audio.AudioManager.PlayAmbience ( string  _id,
bool  _restart = true,
float  _fadeDuration = -1,
float  _volumeMultiplier = 1f 
)
static

Play ambience with given sound name/ID in SoundLibrary.

Parameters
_id
_fadeDurationSet to 0 to disable crossfade, and set to -1 to use default fade duration.

◆ PlayBGM() [1/2]

static void Calcatz.CookieCutter.Audio.AudioManager.PlayBGM ( AudioClip  _clip,
bool  _restart = true,
float  _fadeDuration = -1,
float  _volumeMultiplier = 1f 
)
static

Play music with given crossfade duration.

Parameters
_clip
_restartRestart if the clip has already been played.
_fadeDurationSet to 0 to disable crossfade, and set to -1 to use default fade duration.

◆ PlayBGM() [2/2]

static void Calcatz.CookieCutter.Audio.AudioManager.PlayBGM ( string  _id,
bool  _restart = true,
float  _fadeDuration = -1,
float  _volumeMultiplier = 1f 
)
static

Play music with given sound name/ID in SoundLibrary.

Parameters
_id
_restartRestart if the clip has already been played.
_fadeDurationSet to 0 to disable crossfade, and set to -1 to use default fade duration.

◆ PlayME2D()

static void Calcatz.CookieCutter.Audio.AudioManager.PlayME2D ( string  _id,
System.Action  _onComplete = null,
float  _volumeMultiplier = 1f 
)
static

Play 2D music effect with given name/ID in SoundLibrary, ignoring the position of sound's source.

Parameters
_id

◆ PlayMEAtPosition()

static void Calcatz.CookieCutter.Audio.AudioManager.PlayMEAtPosition ( string  _id,
Vector3  _position,
System.Action  _onComplete = null,
float  _volumeMultiplier = 1f 
)
static

Play music effect with given name/ID in SoundLibrary on the given position.

Parameters
_id
_position

◆ PlaySFX2D()

static void Calcatz.CookieCutter.Audio.AudioManager.PlaySFX2D ( string  _id,
System.Action  _onComplete = null,
float  _volumeMultiplier = 1f 
)
static

Play 2D sound effect with given name/ID in SoundLibrary, ignoring the position of sound's source.

Parameters
_id

◆ PlaySFXAtPosition()

static void Calcatz.CookieCutter.Audio.AudioManager.PlaySFXAtPosition ( string  _id,
Vector3  _position,
System.Action  _onComplete = null,
float  _volumeMultiplier = 1f 
)
static

Play sound effect with given name/ID in SoundLibrary on the given position.

Parameters
_id
_position

◆ PlaySound2D()

static AudioSource Calcatz.CookieCutter.Audio.AudioManager.PlaySound2D ( AudioClip  _clip,
float  _volume = -1,
System.Action  _onComplete = null 
)
static

Play 2D sound, ignoring the position of sound's source.

Parameters
_clip
_volumeIf volume is less than 0, then the value will set to master volume.
_onComplete
Returns

◆ PlaySoundAtPosition()

static AudioSource Calcatz.CookieCutter.Audio.AudioManager.PlaySoundAtPosition ( AudioClip  _clip,
Vector3  _position,
float  _volume = -1,
System.Action  _onComplete = null 
)
static

Play 3D sound on the given position.

Parameters
_clip
_position
_volumeIf volume is less than 0, then the value will set to master volume.
_onComplete
Returns

◆ RemoveAudioSourceInstance()

static void Calcatz.CookieCutter.Audio.AudioManager.RemoveAudioSourceInstance ( AudioSourceAutoAdjustVolume  _audioSource)
static

◆ ResumeAmbience()

static void Calcatz.CookieCutter.Audio.AudioManager.ResumeAmbience ( float  _fadeDuration = -1)
static

Resume the previously stopped ambience with given crossfade duration.

Parameters
_fadeDurationSet to 0 to disable crossfade, and set to -1 to use default fade duration.

◆ ResumeBGM()

static void Calcatz.CookieCutter.Audio.AudioManager.ResumeBGM ( float  _fadeDuration = -1)
static

Resume the previously stopped BGM.

Parameters
_fadeDurationSet to 0 to disable crossfade, and set to -1 to use default fade duration.

◆ SetVolume()

static void Calcatz.CookieCutter.Audio.AudioManager.SetVolume ( float  _volumePercent,
Channel  _channel 
)
static

Set volume of the selected channel.

Parameters
_volumePercent
_channel

◆ StopAmbience()

static void Calcatz.CookieCutter.Audio.AudioManager.StopAmbience ( float  _fadeDuration = -1)
static

Stop current ambience with given crossfade duration.

Parameters
_fadeDurationSet to 0 to disable crossfade, and set to -1 to use default fade duration.

◆ StopBGM()

static void Calcatz.CookieCutter.Audio.AudioManager.StopBGM ( float  _fadeDuration = -1)
static

Stop current music with given crossfade duration.

Parameters
_fadeDuration

Property Documentation

◆ Instance

AudioManager Calcatz.CookieCutter.Audio.AudioManager.Instance
staticget