代码语言:javascript复制
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时屏蔽镜头移动