unity ugui怎么判断鼠标在ui上
2个回答
展开全部
/// <summary>
/// 鼠标是否在Ngui的UI界面上
/// </summary>
public static bool IsMouseOverUI
{
get
{
Vector3 mousePostion=Input.mousePosition;
GameObject hoverobject = UICamera.Raycast(mousePostion, out UICamera.lastHit) ? UICamera.lastHit.collider.gameObject : null;
if (hoverobject != null)
{
return true;
}
else
{
return false;
}
}
}
/// 鼠标是否在Ngui的UI界面上
/// </summary>
public static bool IsMouseOverUI
{
get
{
Vector3 mousePostion=Input.mousePosition;
GameObject hoverobject = UICamera.Raycast(mousePostion, out UICamera.lastHit) ? UICamera.lastHit.collider.gameObject : null;
if (hoverobject != null)
{
return true;
}
else
{
return false;
}
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2016-07-21
展开全部
public class Calcul {
public static void main(String[] args) {
circularArea();
}
public static void circularArea(){
int r=2;
float π=3.14f;
float circularArea = π*r*r;
System.out.println(circularArea);
}
public static void main(String[] args) {
circularArea();
}
public static void circularArea(){
int r=2;
float π=3.14f;
float circularArea = π*r*r;
System.out.println(circularArea);
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询