if (Input.GetMouseButtonUp(0))
{
//判断点击的是否是UI
if (EventSystem.current.IsPointerOverGameObject())
{
Debug.Log("点击到了UI上");
}
else
{
Debug.Log("没有点击到UI上");
}
}
2、获得当前点击到的ui物体
/// <summary>
/// 获得当前点击到的UI物体
/// </summary>
public GameObject Skode_GetCurrentSelect()
{
GameObject obj=null;
GraphicRaycaster[] graphicRaycasters = FindObjectsOfType<GraphicRaycaster>();