public AudioSourceFader(AudioSource source) { this.source = source; timerFade = new Timer(1.0f, null, false, true); timerBeforeFade = new Timer(1.0f, TimerBeforeFadeFinished, false, true); interpolator = new InterpolateFromCurrent <float>(Mathf.Lerp, timerFade, SetVolume, GetVolume); }
// Call this method in derived classes. public void SetInterpolateFunction(InterpolateFromCurrent <TValue> .InterpolateHandler fn) { interpolator.SetInterpolateFunction(fn); }
private void Awake() { interpolator = new InterpolateFromCurrent <TValue>(null, timer, accessor.Set, accessor.Get); }