/// <summary> /// fades out the audio clip over time. Note that if the clip finishes before the fade completes it will short circuit /// the fade and stop playing /// </summary> /// <param name="duration">Duration.</param> /// <param name="handler">Handler.</param> public void fadeOut(float duration, Action handler = null) { _manager.StartCoroutine ( doFadeOut(duration, () => { if (handler != null) { handler(); } }) ); }
/// <summary> /// fades out the audio clip over time. Note that if the clip finishes before the fade completes it will short circuit /// the fade and stop playing /// </summary> /// <param name="duration">Duration.</param> /// <param name="handler">Handler.</param> public void fadeOutAndStop(float duration, Action handler = null) { Manager.StartCoroutine ( fadeOut(duration, () => { if (handler != null) { handler(); } }) ); }