public void OnUpdate(ISound sound) { _time += Time.deltaTime; var delta = _time / _durationSeconds; sound.GetAudioSource().volume = Mathf.Lerp(_startVolume, _endVolume, delta); if (delta >= 1f) { Completed?.Invoke(this, EventArgs.Empty); } }
public void OnStart(ISound sound) { sound.GetAudioSource().volume = _startVolume; }