Unity UGUI判断是否点中UI

#if UNITY_EDITOR
        pointerOverUI = EventSystem.current.IsPointerOverGameObject();
#elif UNITY_ANDROID || UNITY_IOS
        if (Input.touchCount > 0)
        {
    
    
            pointerOverUI = EventSystem.current.IsPointerOverGameObject(Input.GetTouch(0).fingerId);
        }
#endif

猜你喜欢

转载自blog.csdn.net/iningwei/article/details/114133301
今日推荐