protected float GetAxis(IndexedList <ControlAxisKey> keys, int time, float defvalue = default) { while (keys.HasNext && time < keys.Current.timing) { keys.index++; } if (!keys.HasNext) { return(keys.Current.targetValue); } if (keys.HasPrevious) { return((keys.Current.targetValue - defvalue) * ((float)time / keys.Current.timing)); } return(math.lerp(keys.Previous.targetValue, keys.Current.targetValue, Easing.Do(math.unlerp(keys.Previous.timing, keys.Current.timing, time), keys.Previous.easing))); }