remove anim code

This commit is contained in:
vis2k 2023-01-26 23:59:38 +09:00
parent fb2d8d380a
commit 5a5788fac5

View File

@ -122,11 +122,6 @@ void Update()
HandleJumping(); HandleJumping();
HandleMove(); HandleMove();
#if !UNITY_SERVER
// Not needed on headless clients
HandleAnimation();
#endif
// Reset ground state // Reset ground state
if (characterController.isGrounded) if (characterController.isGrounded)
groundState = GroundState.Grounded; groundState = GroundState.Grounded;
@ -152,30 +147,6 @@ void HandleMoveState()
moveState = MoveMode.Walking; moveState = MoveMode.Walking;
} }
void HandleAnimation()
{
if (!animator) return;
//if (moveState != MoveState.Sneaking)
//{
// if (Input.GetKeyUp(KeyCode.I))
// animator.SetTrigger("Saluting");
// else if (Input.GetKeyUp(KeyCode.O))
// animator.SetTrigger("Waving");
// else if (Input.GetKeyUp(KeyCode.P))
// animator.SetBool("Dancing", !animator.GetBool("Dancing"));
//}
animVelocity = -transform.InverseTransformDirection(direction).z / moveSpeedMultiplier;
animRotation = -turnSpeed / maxTurnSpeed;
animator.SetFloat("Forward", Mathf.MoveTowards(animator.GetFloat("Forward"), animVelocity, moveSpeedMultiplier * Time.deltaTime));
animator.SetFloat("Turn", Mathf.MoveTowards(animator.GetFloat("Turn"), animRotation, maxTurnSpeed * Time.deltaTime));
animator.SetBool("Crouch", moveState == MoveMode.Sneaking);
animator.SetBool("OnGround", groundState == GroundState.Grounded);
}
#endif #endif