C# Class Sol.SoundManager

Inheritance: UnityEngine.MonoBehaviour
Show file Open project: Stumpstump/RoverGame

Public Properties

Property Type Description
collections List
effectsGroup UnityEngine.Audio.AudioMixerGroup
masterMixer UnityEngine.Audio.AudioMixer
musicGroup UnityEngine.Audio.AudioMixerGroup
soundSourcePrefab SoundSource
sources List
voicesGroup UnityEngine.Audio.AudioMixerGroup

Public Methods

Method Description
Find ( AudioClip audioClip ) : Sound

Return sound of given audio clip

Find ( int soundId ) : Sound

Return sound of given ID

Find ( string soundName ) : Sound

Return sound of given sound name

IsPlaying ( Sound sound ) : bool

Return whether or not sound source of given sound is playing

Play ( AudioClip audioClip, float fadeTime = 0f, Transform parent = null, Vector3 position = default(Vector3) ) : SoundSource

Play sound source of given audio clip

Play ( Sound sound, float fadeTime = 0f, Transform parent = null, Vector3 position = default(Vector3) ) : SoundSource

Play sound source of given sound

Play ( int soundId, float fadeTime = 0f, Transform parent = null, Vector3 position = default(Vector3) ) : SoundSource

Play sound source of given ID

Play ( string soundName, float fadeTime = 0f, Transform parent = null, Vector3 position = default(Vector3) ) : SoundSource

Play sound source of given sound name

Reset ( ) : void

clear out sound sources from the obect pool

Stop ( Sound sound ) : void

Stop playing sound of given sound

Stop ( SoundSource soundSource ) : void

Stop sound of given sound source

Stop ( int soundId ) : void

Stop sound of given ID

Private Methods

Method Description
GetSoundSource ( Sound sound, Transform parent, Vector3 position ) : SoundSource

Get sound source from collections

Initialize ( Sound sound, float fadeTime ) : void

Initialize sound

OnSoundSourceStop ( SoundSource source ) : void

Cleanup sound source

Method Details

Find() public method

Return sound of given audio clip
public Find ( AudioClip audioClip ) : Sound
audioClip UnityEngine.AudioClip
return Sound

Find() public method

Return sound of given ID
public Find ( int soundId ) : Sound
soundId int
return Sound

Find() public method

Return sound of given sound name
public Find ( string soundName ) : Sound
soundName string
return Sound

IsPlaying() public method

Return whether or not sound source of given sound is playing
public IsPlaying ( Sound sound ) : bool
sound Sound
return bool

Play() public method

Play sound source of given audio clip
public Play ( AudioClip audioClip, float fadeTime = 0f, Transform parent = null, Vector3 position = default(Vector3) ) : SoundSource
audioClip UnityEngine.AudioClip
fadeTime float
parent UnityEngine.Transform
position UnityEngine.Vector3
return SoundSource

Play() public method

Play sound source of given sound
public Play ( Sound sound, float fadeTime = 0f, Transform parent = null, Vector3 position = default(Vector3) ) : SoundSource
sound Sound
fadeTime float
parent UnityEngine.Transform
position UnityEngine.Vector3
return SoundSource

Play() public method

Play sound source of given ID
public Play ( int soundId, float fadeTime = 0f, Transform parent = null, Vector3 position = default(Vector3) ) : SoundSource
soundId int
fadeTime float
parent UnityEngine.Transform
position UnityEngine.Vector3
return SoundSource

Play() public method

Play sound source of given sound name
public Play ( string soundName, float fadeTime = 0f, Transform parent = null, Vector3 position = default(Vector3) ) : SoundSource
soundName string
fadeTime float
parent UnityEngine.Transform
position UnityEngine.Vector3
return SoundSource

Reset() public method

clear out sound sources from the obect pool
public Reset ( ) : void
return void

Stop() public method

Stop playing sound of given sound
public Stop ( Sound sound ) : void
sound Sound
return void

Stop() public method

Stop sound of given sound source
public Stop ( SoundSource soundSource ) : void
soundSource SoundSource
return void

Stop() public method

Stop sound of given ID
public Stop ( int soundId ) : void
soundId int
return void

Property Details

collections public property

public List collections
return List

effectsGroup public property

public AudioMixerGroup,UnityEngine.Audio effectsGroup
return UnityEngine.Audio.AudioMixerGroup

masterMixer public property

public AudioMixer,UnityEngine.Audio masterMixer
return UnityEngine.Audio.AudioMixer

musicGroup public property

public AudioMixerGroup,UnityEngine.Audio musicGroup
return UnityEngine.Audio.AudioMixerGroup

soundSourcePrefab public property

public SoundSource,Sol soundSourcePrefab
return SoundSource

sources public property

public List sources
return List

voicesGroup public property

public AudioMixerGroup,UnityEngine.Audio voicesGroup
return UnityEngine.Audio.AudioMixerGroup