TooltipAttribute

class in UnityEngine

/

Inherits from:PropertyAttribute

Switch to Manual

Description

为 Inspector 窗口中的字段指定工具提示。


Tooltip hovering over the class it was added to.

下面的脚本中添加了一个 health。它向用户提供有关 health 变量的值的范围信息。建议的范围在 TooltipAttribute 字符串中提供。

using UnityEngine;

public class Example : MonoBehaviour { [Tooltip("Health value between 0 and 100.")] int health = 0; }

Variables

tooltip工具提示文本。

Constructors

TooltipAttribute为字段指定工具提示。

Inherited members

Variables

order可选字段,用于指定多个 DecorationDrawer 应采用的绘制顺序。