//鼠标点击事件
//点击的是 UI
if (EventSystem.current.IsPointerOverGameObject())
{
Debug.Log("Clicked on the UI");
return;
}
else
{
Vector2 orgPos = cam.ScreenToWorldPoint(Input.mousePosition);
RaycastHit2D[] hitArr = Physics2D.RaycastAll(orgPos, Vector2.zero);
if (hitArr.Length > 0)
{
Unity 笔记鼠标点击事件
最新推荐文章于 2024-01-22 19:44:55 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)