public void FadeIn(float duration, ExtendedAudioSource source = null) { if (source == null) { source = AudioPool.GetAudioSource(); } source.Setup(this); source.FadeIn(duration); }
public void PlayDelayed(float delay, ExtendedAudioSource source = null) { if (source == null) { source = AudioPool.GetAudioSource(); } source.Setup(this); source.PlayDelayed(delay); }
public void Pause(ExtendedAudioSource source = null) { if (source == null) { source = AudioPool.GetAudioSource(); } source.Pause(); }
public void PlayOnce(ExtendedAudioSource source = null) { if (source == null) { source = AudioPool.GetAudioSource(); } source.Setup(this); source.PlayOnce(); }
public void Stop(ExtendedAudioSource source = null) { //Get audiosource if (source == null) { source = AudioPool.GetAudioSource(); } source.Stop(); }
public void Play(ExtendedAudioSource source = null) { //Get audiosource if (source == null) { source = AudioPool.GetAudioSource(); } source.Setup(this); source.Play(); }
private void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } pool = GetComponent <AudioPool>(); }
public void Update() { if (isPaused) { return; } if (!source.isPlaying) { AudioPool.ReturnToPool(this); } else { isPlaying = true; } }