自定義UI阻擋區域

    public bool IsRaycastLocationValid(Vector2 sp, Camera eventCamera)
    {
        RectTransformUtility.ScreenPointToLocalPointInRectangle(transform as RectTransform, sp, UIManager.instance.uiCamera, out sp);
        if (sp.x > m_rect.x - m_rect.z * .5f 
            && sp.x < m_rect.x + m_rect.z * .5f
            && sp.y > m_rect.y - m_rect.w * .5f
            && sp.y < m_rect.y + m_rect.w * .5f)
        {
            return false;
        }
        return true;
    }

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章