From 5a5788fac5c709fb228115a461b2659770bdb491 Mon Sep 17 00:00:00 2001 From: vis2k Date: Thu, 26 Jan 2023 23:59:38 +0900 Subject: [PATCH] remove anim code --- .../Examples/TestNT/Scripts/PlayerMove.cs | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/Assets/Mirror/Examples/TestNT/Scripts/PlayerMove.cs b/Assets/Mirror/Examples/TestNT/Scripts/PlayerMove.cs index 75082b29d..b6d9f9ff0 100644 --- a/Assets/Mirror/Examples/TestNT/Scripts/PlayerMove.cs +++ b/Assets/Mirror/Examples/TestNT/Scripts/PlayerMove.cs @@ -122,11 +122,6 @@ void Update() HandleJumping(); HandleMove(); -#if !UNITY_SERVER - // Not needed on headless clients - HandleAnimation(); -#endif - // Reset ground state if (characterController.isGrounded) groundState = GroundState.Grounded; @@ -152,30 +147,6 @@ void HandleMoveState() 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