public override void AnimatorIKTick(Animator animator)
{
if (isActiveAndEnabled && controller.enabled)
{
float expected = animator.deltaPosition.magnitude;
Vector3 start = transform.position;
controller.stepOffset = 0.3f * entity.LinearScale;
controller.minMoveDistance = 0.001f * entity.LinearScale;
controller.Move((1 + bonusSpeed) * animator.deltaPosition + Vector3.down * 10f * Time.deltaTime);
Vector3 end = transform.position;
float actual = Vector3.Distance(start, transform.position);
if (debugShowDelta)
{
DebugDrawer.Instance.RequestAction(() =>
{
Gizmos.color = Color.red;
Gizmos.DrawSphere(start, 0.02f);
});
DebugDrawer.Instance.RequestAction(() =>
{
Gizmos.color = Color.blue;
Gizmos.DrawSphere(end, 0.02f);
});
}
if (expected / 3 > actual)
{
// slowdown = Mathf.MoveTowards(slowdown, 1, Time.deltaTime * 4);
}
}
}