mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 19:10:32 +00:00
remove anim code
This commit is contained in:
parent
fb2d8d380a
commit
5a5788fac5
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user