相机移动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

@ -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();
} }
} }