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()