public void SetFadeOut(bool remove = false) { timeLeft = EngineDelegate.VolumeDuration; isFadeIn = false; audioSource.volume = GOEAudioMgr.GetVolumeByType(type); removeAtEnd = remove; }
public void SetVolume() { if (isFadeIn) { audioSource.volume = ((EngineDelegate.VolumeDuration - timeLeft) * GOEAudioMgr.GetVolumeByType(type) / EngineDelegate.VolumeDuration); } else { audioSource.volume = timeLeft * GOEAudioMgr.GetVolumeByType(type) / EngineDelegate.VolumeDuration; } }