bool CheckGuiRaycastObjects()
{
PointerEventData eventData = new PointerEventData(EventSystem.current);
eventData.pressPosition = Input.mousePosition;
eventData.position = Input.mousePosition;
List<RaycastResult> list = new List<RaycastResult>();
EventSystem.current.RaycastAll(eventData, list);
//Debug.Log(list.Count);
return list.Count > 0;
}
void Update()
{
if (CheckGuiRaycastObjects())
{
return;
}
}