touch style pause menu items only trigger if cursor is over an item

This commit is contained in:
minenice55 2023-11-10 20:04:39 -05:00
parent dd2d16634e
commit c11fd6a618

View file

@ -158,7 +158,17 @@ namespace HeavenStudio.Common
}
else if (Input.GetKeyDown(KeyCode.Return) || PlayerInput.GetInputController(1).GetActionDown(PlayerInput.CurrentControlStyle, btConfirm, out _))
{
UseOption((Options)optionSelected);
if (PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch)
{
if (optionHolder.transform.GetChild(optionSelected).GetComponent<Collider2D>().OverlapPoint(PlayerInput.GetInputController(1).GetPointer()))
{
UseOption((Options)optionSelected);
}
}
else
{
UseOption((Options)optionSelected);
}
}
}