I have 2d objects that respond to mouse clicks. There is a UI panel For the whole screen and when I click on this panel, clicks are triggered on objects under the UI panel. How to fix it? I do it on the phone. Unity Version 2019
This code works on a PC, but not on a phone
public void OnMouseDown()
{
if (EventSystem.current.IsPointerOverGameObject() || EventSystem.current.currentSelectedGameObject != null)
{
}
else
{
WoodFarmPanel.SetActive(true);
}
}