using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class xuanting2 : MonoBehaviour
{
// Start is called before the first frame update
bool isShowTip;
void Start()
{
isShowTip=false;
}
void OnMouseEnter(){
isShowTip=true;
}
void OnMouseExit(){
isShowTip=false;
}
void OnGUI(){
if(isShowTip){
GUIStyle style=new GUIStyle();
style.fontSize=50;
style.normal.textColor=Color.blue;
GUI.Label(new Rect(Input.mousePosition.x,Screen.height-Input.mousePosition.y,100,100),"2号风机" ,style);
}
}
}
添加悬停目标,显示出相应文字