private void Update()
{
if (Input.GetMouseButtonDown(0))
{
#if !UNITY_EDITOR//手机模式
if (!EventSystem.current.IsPointerOverGameObject(Input.GetTouch(0).fingerId))
#else//编辑器模式
if (!EventSystem.current.IsPointerOverGameObject())
#endif
{
//没有点击到UI上
}
}
}
UGUI 判断点击在UI上还是屏幕中
最新推荐文章于 2022-08-25 15:44:51 发布