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