解决NGUI触发事件点透问题

 

 

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


通过射线判断

 

方法如下:

 

<span style="white-space:pre">	</span>RaycastHit hit=new RaycastHit();
        if (!UICamera.Raycast(Input.mousePosition,out hit))
        {
            //代码。。
        } 

 

posted @ 2015-07-28 17:18  Harlan1009  阅读(289)  评论(0编辑  收藏  举报