Fix issue with mouse (new input system)

This commit is contained in:
2025-06-04 22:16:16 -07:00
parent 59c8ce99ca
commit 364de8a944

View File

@@ -150,7 +150,7 @@ public class GamePlayer : MonoBehaviour
{ {
doMoveRight = true; doMoveRight = true;
} }
if (controllerJump || Keyboard.current.spaceKey.isPressed || Keyboard.current.upArrowKey.isPressed || Keyboard.current.wKey.isPressed || (Mouse.current.IsPressed() && PlayerPrefs.GetInt("Setting2", 0) == 0) || (Gamepad.current != null && Gamepad.current.buttonSouth.isPressed)) if (controllerJump || Keyboard.current.spaceKey.isPressed || Keyboard.current.upArrowKey.isPressed || Keyboard.current.wKey.isPressed || (Mouse.current.leftButton.isPressed && PlayerPrefs.GetInt("Setting2", 0) == 0) || (Gamepad.current != null && Gamepad.current.buttonSouth.isPressed))
{ {
doJump = true; doJump = true;
} }
@@ -168,7 +168,7 @@ public class GamePlayer : MonoBehaviour
GameObject backButton = GameObject.Find("BackButton"); GameObject backButton = GameObject.Find("BackButton");
if (!Application.isMobilePlatform) if (!Application.isMobilePlatform)
{ {
if (Mouse.current.IsPressed()) if (Mouse.current.leftButton.isPressed)
{ {
UnityEngine.Vector3 touchPosition = Camera.main.ScreenToWorldPoint(Pointer.current.position.ReadValue()); UnityEngine.Vector3 touchPosition = Camera.main.ScreenToWorldPoint(Pointer.current.position.ReadValue());
touchPosition.z = 0f; touchPosition.z = 0f;