From a4d6eb660518a2608f7cad5c3c3fd02829257275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=B8=E6=88=8F=E7=B3=95=E6=89=8B=E7=88=B1=E4=B8=BD?= =?UTF-8?q?=E4=B8=9D?= <1747715394@qq.com> Date: Thu, 27 Nov 2025 16:49:21 +0800 Subject: [PATCH] 111 --- Assets/Scripts/StudyCase2/ThirdCharacterController.cs | 4 ++-- Assets/Scripts/StudyCase3/ThirdCharacterController.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/StudyCase2/ThirdCharacterController.cs b/Assets/Scripts/StudyCase2/ThirdCharacterController.cs index c0fc07b..8234109 100644 --- a/Assets/Scripts/StudyCase2/ThirdCharacterController.cs +++ b/Assets/Scripts/StudyCase2/ThirdCharacterController.cs @@ -38,11 +38,11 @@ namespace StudyCase2 moveDir = forward.TransformDirection(moveDir); if (moveInput != Vector2.zero) { - animator?.SetBool("Move", true); + animator.SetBool("Move", true); Quaternion target = Quaternion.LookRotation(new Vector3(moveDir.x, 0, moveDir.z)); model.rotation = Quaternion.Slerp(model.rotation, target, turnSpeed * Time.deltaTime); } - else animator?.SetBool("Move", false); + else animator.SetBool("Move", false); if (!characterController.isGrounded) moveDir.y -= gravity * Time.deltaTime; characterController.Move(moveDir * moveSpeed * Time.deltaTime); diff --git a/Assets/Scripts/StudyCase3/ThirdCharacterController.cs b/Assets/Scripts/StudyCase3/ThirdCharacterController.cs index 733e367..8f4e64e 100644 --- a/Assets/Scripts/StudyCase3/ThirdCharacterController.cs +++ b/Assets/Scripts/StudyCase3/ThirdCharacterController.cs @@ -82,11 +82,11 @@ namespace StudyCase3 moveDir = forward.TransformDirection(moveDir); if (moveInput != Vector2.zero) { - animator?.SetBool("Move", true); + animator.SetBool("Move", true); Quaternion target = Quaternion.LookRotation(new Vector3(moveDir.x, 0, moveDir.z)); model.rotation = Quaternion.Slerp(model.rotation, target, turnSpeed * Time.deltaTime); } - else animator?.SetBool("Move", false); + else animator.SetBool("Move", false); if (!characterController.isGrounded) moveDir.y -= gravity * Time.deltaTime; characterController.Move(moveDir * moveSpeed * Time.deltaTime);