using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MouseClickBehaviourScript : MonoBehaviour {
bool isShowTip;
// Use this for initialization
void Start () {
isShowTip = false;
}
// Update is called once per frame
void Update () {
}
void OnMouseEnter()
{
isShowTip = true;
}
void OnMouseExit()
{
isShowTip = false;
}
void OnGUI()
{
if (isShowTip)
{
GUI.Label(new Rect(Input.mousePosition.x, Screen.height - Input.mousePosition.y, 100, 40), "My name is " + name);
}
}
}
U3D显示鼠标悬停位置物件的名字
最新推荐文章于 2023-02-02 15:13:04 发布