/// <summary> /// 恢复播放背景音乐 /// </summary> /// <param name="isGradual">是否渐进式</param> public void UnPauseBackgroundMusic(bool isGradual = true) { if (isGradual) { BackgroundAudio.volume = 0; BackgroundAudio.UnPause(); BackgroundAudio.DOFade(BackgroundVolume, 2); } else { BackgroundAudio.UnPause(); } }
/// <summary> /// 暂停播放背景音乐 /// </summary> /// <param name="isGradual">是否渐进式</param> public void PauseBackgroundMusic(bool isGradual = true) { if (isGradual) { BackgroundAudio.DOFade(0, 2).OnComplete(() => { BackgroundAudio.Pause(); BackgroundAudio.volume = BackgroundVolume; }); } else { BackgroundAudio.Pause(); } }