From 0e36c4c6d3adc1dd8723d35d8fce8dfa513175c9 Mon Sep 17 00:00:00 2001 From: huyulong <1838407198@qq.com> Date: Tue, 19 Nov 2024 11:18:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=91=87=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 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs b/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs index 52e76359..554bb072 100644 --- a/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs +++ b/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs @@ -113,8 +113,7 @@ public class PlayerMovement_Joystick : MonoBehaviour } // 应用移动 - if (moveDirection.magnitude > 0.1f) - { + Vector3 newPosition = rb.position + moveDirection * moveSpeed * Time.fixedDeltaTime; rb.MovePosition(newPosition); MoveState(); @@ -122,7 +121,7 @@ public class PlayerMovement_Joystick : MonoBehaviour // 使角色面朝移动方向 Quaternion toRotation = Quaternion.LookRotation(moveDirection, Vector3.up); transform.rotation = Quaternion.RotateTowards(transform.rotation, toRotation, 720 * Time.deltaTime); - } + } void HandleViewSwipe(Touch touch)