private static bool IsPointerOverUIObject()
{
PointerEventData eventDataCurrentPosition = new PointerEventData(EventSystem.current);
#if !ANDROID
eventDataCurrentPosition.position = new Vector3(Input.mousePosition.x, Input.mousePosition.y,Input.mousePosition.z);
#else
eventDataCurrentPosition.position = new Vector3(Input.GetTouch(0).position.x, Input.GetTouch(0).position.y);
#endif
List<RaycastResult> results = new List<RaycastResult>();
EventSystem.current.RaycastAll(eventDataCurrentPosition, results);
return results.Count > 0;
}
if (EventSystem.current.IsPointerOverGameObject())
{}
public void OnMouseDown()
{
if (EventSystem.current.IsPointerOverGameObject() || EventSystem.current.currentSelectedGameObject != null)
{
}
else
{
FoodFarmPanel.SetActive(true);
}
}