您的位置:首页 > 产品设计 > UI/UE

NGUI点击按钮时如何屏蔽场景鼠标事件

2014-12-23 10:45 435 查看
using UnityEngine;
using System.Collections;
public class hh : MonoBehaviour {
public bool e = true;
// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}
void OnMouseDown(){
if(UICamera.hoveredObject == null){
if(e==true){
GameObject.Find("box").renderer.material.color = Color.red;
e=false;
}
else if(e==false){
GameObject.Find("box").renderer.material.color = Color.yellow;
e=true;
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: