From f52e5b1edc580a0e348d066fd63f722b59f6ce2a Mon Sep 17 00:00:00 2001 From: huyulong <1838407198@qq.com> Date: Tue, 19 Nov 2024 14:27:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BB=91=E5=8A=A8=E8=A7=86=E8=A7=92test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Script/Character/PlayerMovement_Jpystick.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs b/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs index c3c6f19d..6601c405 100644 --- a/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs +++ b/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs @@ -72,7 +72,12 @@ public class PlayerMovement_Jpystick : MonoBehaviour else if (touch.fingerId == rightFingerId) { // 右侧触摸:滑动视角 - HandleViewSwipe(touch); + //HandleViewSwipe(touch); + float horizontalSwipe = touch.deltaPosition.x * 0.1f; // 可调整灵敏度 + float verticalSwipe = -touch.deltaPosition.y * 0.1f; + + cameraTransform.Rotate(0, horizontalSwipe, 0, Space.World); + cameraTransform.Rotate(verticalSwipe, 0, 0, Space.Self); } } else if (touch.phase == TouchPhase.Ended || touch.phase == TouchPhase.Canceled) @@ -141,11 +146,7 @@ public class PlayerMovement_Jpystick : MonoBehaviour void HandleViewSwipe(Touch touch) { // 滑动视角逻辑 - float horizontalSwipe = touch.deltaPosition.x * 0.1f; // 可调整灵敏度 - float verticalSwipe = -touch.deltaPosition.y * 0.1f; - - cameraTransform.Rotate(0, horizontalSwipe, 0, Space.World); - cameraTransform.Rotate(verticalSwipe, 0, 0, Space.Self); + } public void MoveState()