GUIContent.tooltip

Unity · Версия 2020.3 LTS · Scripting · GUIContent

GUIContent.tooltip

public string tooltip;

Описание

Подсказка этого элемента.

Подсказка, связанная с этим контентом. Прочтите GUItooltip, чтобы получить всплывающую подсказку элемента графического интерфейса, над которым в данный момент находится пользователь.

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);
    }
}

Обновлено 17 ноября 2026 г.