相机移动bug

This commit is contained in:
杨号敬 2024-12-26 04:17:03 +08:00
parent 965bc503d5
commit e7d9b0dd5e
3 changed files with 7 additions and 5 deletions

View File

@ -18,6 +18,7 @@ public class DragTheScreen : MonoBehaviour, IDragHandler
{ {
if (isscanmove) if (isscanmove)
{ {
Player.GetComponent<PlayerMovement_Jpystick>().HandleViewSwipe(); Player.GetComponent<PlayerMovement_Jpystick>().HandleViewSwipe();
} }

View File

@ -136,13 +136,13 @@ public class PlayerMovement_Jpystick : MonoBehaviour, IDragHandler
} }
public void HandleViewSwipe() 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 else

View File

@ -18,7 +18,7 @@ public class UseSkill : MonoBehaviour
// 玩家手中当前持有的物品 // 玩家手中当前持有的物品
//[HideInInspector] //[HideInInspector]
public GameObject currentItem = null; public GameObject currentItem = null;
public Skill_Pick _skill_Pick; public Skill_Pick _skill_Pick;
public Skill_Jump _skill_Jump; public Skill_Jump _skill_Jump;
public Skill_watering _skill_Watering; 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); float dis= Vector3.Distance(GameObject.Find("player").transform.position, XFS.instance.transform.position);
if (dis >= 30f) if (dis >= 30f)
{ {
Drop(); Drop();
} }
} }