protected void OnDisable() { if (quitting) { return; } if (looped || stopOnDestroy) { if (instance != null) { instance.Stop(); } if (audioSource != null) { SoundManager.StopPooledClip(audioSource); } } }
public void OnDestroy() { if (isQuitting) { return; } if (instance != null) { instance.Stop(); } }
private void FadeOutCurrentChild(float time) { if (currentChild == null) { return; } //Swap children ArdenAudioInstance oChild = fadingOutChild; fadingOutChild = currentChild; currentChild = oChild; //If we've already been fading something out, then just force stop it if (currentChild != null) { currentChild.Stop(); currentChild = null; } fadingOutChild.FadeOut(time); }
public override void Stop() { if (completed) { return; } base.Stop(); if (currentChild != null) { currentChild.Stop(); } if (fadingOutChild != null) { fadingOutChild.Stop(); } currentChild = null; fadingOutChild = null; //Stop any coroutines as well }