From e7d9b0dd5e6530e75f0fb8c8dac049cb4023d6d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=8F=B7=E6=95=AC?= <153802103@qq.com> Date: Thu, 26 Dec 2024 04:17:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B8=E6=9C=BA=E7=A7=BB=E5=8A=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaofang/Assets/Script/Character/DragTheScreen.cs | 1 + .../Assets/Script/Character/PlayerMovement_Jpystick.cs | 8 ++++---- xiaofang/Assets/Script/Character/Skills/UseSkill.cs | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/xiaofang/Assets/Script/Character/DragTheScreen.cs b/xiaofang/Assets/Script/Character/DragTheScreen.cs index 31b30dae..0b24b7dc 100644 --- a/xiaofang/Assets/Script/Character/DragTheScreen.cs +++ b/xiaofang/Assets/Script/Character/DragTheScreen.cs @@ -18,6 +18,7 @@ public class DragTheScreen : MonoBehaviour, IDragHandler { if (isscanmove) { + Player.GetComponent().HandleViewSwipe(); } diff --git a/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs b/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs index 28bc7207..abbd37c7 100644 --- a/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs +++ b/xiaofang/Assets/Script/Character/PlayerMovement_Jpystick.cs @@ -136,13 +136,13 @@ public class PlayerMovement_Jpystick : MonoBehaviour, IDragHandler } public void HandleViewSwipe() { - if (Mathf.Abs(mainCamera.transform.eulerAngles.x - transform.eulerAngles.x) < 315 && Mathf.Abs(mainCamera.transform.eulerAngles.x - transform.eulerAngles.x) > 45) + if (Mathf.Abs(mainCamera.transform.eulerAngles.x - transform.eulerAngles.x) < 270 && Mathf.Abs(mainCamera.transform.eulerAngles.x - transform.eulerAngles.x) > 90) { - + cameraControl.ResetTargetOffsets(); } - if (Mathf.Abs(mainCamera.transform.eulerAngles.y - transform.eulerAngles.y) < 315 && Mathf.Abs(mainCamera.transform.eulerAngles.y - transform.eulerAngles.y) > 45) + if (Mathf.Abs(mainCamera.transform.eulerAngles.y - transform.eulerAngles.y) < 300 && Mathf.Abs(mainCamera.transform.eulerAngles.y - transform.eulerAngles.y) > 60) { - + cameraControl.ResetTargetOffsets(); } else diff --git a/xiaofang/Assets/Script/Character/Skills/UseSkill.cs b/xiaofang/Assets/Script/Character/Skills/UseSkill.cs index 81ca60ee..7dec7409 100644 --- a/xiaofang/Assets/Script/Character/Skills/UseSkill.cs +++ b/xiaofang/Assets/Script/Character/Skills/UseSkill.cs @@ -18,7 +18,7 @@ public class UseSkill : MonoBehaviour // 玩家手中当前持有的物品 //[HideInInspector] public GameObject currentItem = null; - + public Skill_Pick _skill_Pick; public Skill_Jump _skill_Jump; public Skill_watering _skill_Watering; @@ -47,6 +47,7 @@ public class UseSkill : MonoBehaviour float dis= Vector3.Distance(GameObject.Find("player").transform.position, XFS.instance.transform.position); if (dis >= 30f) { + Drop(); } }