public void Stop() { var current = m_CurrentSpeed; var target = 0.0f; void WindDown(float t) { CurrentSpeed = Mathf.Lerp(current, target, t); } StartCoroutine(CoroutineUtility.InvokeOverTimeNormalized(WindDown, windDownDuration)); }
public void Run() { var current = 0.0f; var target = startSpeed; void WindUp(float t) { CurrentSpeed = Mathf.Lerp(current, target, t); } StartCoroutine(CoroutineUtility.InvokeOverTimeNormalized(WindUp, windUpDuration)); }