Version: 2021.1
public string tooltip ;

描述

该元素的工具提示。

与该内容关联的工具提示。读取 GUItooltip 来获取用户当前悬停的 GUI 元素的工具提示。

using UnityEngine;

public class ExampleScript : MonoBehaviour { void OnGUI() { GUI.Button(new Rect(0, 0, 100, 20), new GUIContent("A Button", "This is the tooltip")); // If the user hovers the mouse over the button, the global tooltip gets set GUI.Label(new Rect(0, 40, 100, 40), GUI.tooltip); } }