版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/luoyikun/article/details/82888773
if (Input.GetMouseButtonDown(0))
{
if (Application.isMobilePlatform && Input.touchCount > 0)
{
for (int i = 0; i < Input.touchCount; i++)
{
if (EventSystem.current.IsPointerOverGameObject(Input.GetTouch(i).fingerId))
{
m_isClickUi = true;
break;
}
}
}
else if (EventSystem.current.IsPointerOverGameObject())
{
m_isClickUi = true;
}
}
if (Input.GetMouseButtonUp(0))
{
m_isClickUi = false;
}
if (m_isClickUi == true)
{
return;
}
当点下时ui时屏蔽镜头移动