static IEnumerator _Animate(PropertyInfo info, object target, object end, float time, Lerper lerper, EaseMode mode) { object start = info.GetValue(target); float t = 0; while (t < 1) { t += Time.deltaTime / time; info.SetValue(target, lerper.Lerp(start, end, Ease(t, mode))); yield return(null); } info.SetValue(target, end); }
static IEnumerator _Animate <T>(Action <T> setter, T start, T end, float time, Lerper lerper, EaseMode mode) { setter(start); float t = 0; while (t < 1) { t += Time.deltaTime / time; setter((T)lerper.Lerp(start, end, Ease(t, mode))); yield return(null); } setter(end); }