一个简单Demo
if (Input.GetMouseButtonDown(0) )
{
Debug.Log(EventSystem.current.gameObject.name);
if (EventSystem.current.currentSelectedGameObject)
Debug.Log("当前触摸在UI上");
else Debug.Log("当前没有触摸在UI上");
}