【发布时间】:2016-07-19 03:48:45
【问题描述】:
我试图在鼠标悬停在对象上时显示 GUI 标签,而当鼠标光标从对象上移开时标签隐藏。
谁能告诉我为什么会出现错误?
using UnityEngine;
using System.Collections;
public class label_diet : MonoBehaviour {
public showGUI boolean = false;
void OnMouseOver()
{
showGUI = true;
}
void OnMouseExit()
{
showGUI = false;
}
void OnGUI()
{
if (showGUI)
{
GUI.Label(new Rect(10, 10, 100, 20), "You are selecting Diet coke");
}
}
}
【问题讨论】:
标签: c# user-interface unity3d monodevelop