解决NGUI触发事件点透问题

 

 void OnClick()
    {
        if (UICamera.hoveredObject != null)
        {
            //代码。。
        }
    }


通过射线判断

方法如下:

<span style="white-space:pre">	</span>RaycastHit hit=new RaycastHit();
        if (!UICamera.Raycast(Input.mousePosition,out hit))
        {
            //代码。。
        } 
原文地址:https://www.cnblogs.com/harlan1009/p/4683506.html