From c9a7061fec0da585e0a5a4663e604ad3685b2708 Mon Sep 17 00:00:00 2001 From: huyulong <1838407198@qq.com> Date: Tue, 19 Nov 2024 11:05:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=A7=E7=BB=AD=E4=BF=AE=E6=94=B9=E6=91=87?= =?UTF-8?q?=E6=9D=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs b/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs index b11599cc..52e76359 100644 --- a/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs +++ b/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs @@ -87,7 +87,7 @@ public class PlayerMovement_Joystick : MonoBehaviour float horizontal = joystick.Horizontal; float vertical = joystick.Vertical; - // 转换为三维方向向量 (保持在水平面) + // 转换为三维方向向量 ( 保持在水平面 ) Vector3 inputDirection = new Vector3(horizontal, 0f, vertical); // 获取移动方向相对于摄像机的世界方向 @@ -101,7 +101,7 @@ public class PlayerMovement_Joystick : MonoBehaviour cameraForward.Normalize(); cameraRight.Normalize(); - // 计算最终的移动方向 (相对于摄像机的前后左右) + // 计算最终的移动方向 ( 相对于摄像机的前后左右 ) Vector3 moveDirection = (cameraRight * horizontal + cameraForward * vertical).normalized; if (Mathf.Abs(vertical) > 0.01f || Mathf.Abs(horizontal) > 0.01f) @@ -160,4 +160,4 @@ public class PlayerMovement_Joystick : MonoBehaviour // 使用插值平滑调整相机的FOV mainCamera.fieldOfView = Mathf.Lerp(mainCamera.fieldOfView, targetFOV, fovChangeSpeed * Time.deltaTime); } -} +} \ No newline at end of file