public void PauseSound() { if (GetAudioSource() != null && _clip != null) { if (GetAudioSource().isPlaying == true) { GetAudioSource().Pause(); _currentAudioState = AudioManager.AudioState.Pause; } } }
public void StopSound() { if (GetAudioSource() != null && _clip != null) { if (GetAudioSource().isPlaying == true) { GetAudioSource().Stop(); _currentAudioState = AudioManager.AudioState.Stop; } } }
public void PlaySound(AudioClip clip, AudioSource source) { if (source != null && clip != null) { this._clip = clip; this._audioSource = source; source.clip = clip; if (AudioManager.instance.IsGameAudioOn() == true) { _currentAudioState = AudioManager.AudioState.Playing; source.Play(); } else if (_isBackgroundSound == true) { _currentAudioState = AudioManager.AudioState.Pause; } } }