防止UI穿透操作到游戏场景

#if UNITY_EDITOR || UNITY_STANDALONE_WIN
if (EventSystem.current.IsPointerOverGameObject())
{
return ;
}
#else
if ((Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began))
{
if (EventSystem.current.IsPointerOverGameObject(Input.GetTouch(0).fingerId))
{
return ;
}
}
#endif

posted @ 2016-11-16 17:52  巨蟹Only过客  阅读(407)  评论(0编辑  收藏  举报