标签:
void OnClick()
{
if (UICamera.hoveredObject != null)
{
//代码。。
}
}
通过射线判断
方法如下:
<span style="white-space:pre"> </span>RaycastHit hit=new RaycastHit();
if (!UICamera.Raycast(Input.mousePosition,out hit))
{
//代码。。
}
标签:
原文地址:http://www.cnblogs.com/harlan1009/p/4683506.html