Version 3.3.1.2

Odin has a dedicated attribute overview with examples

PropertyTooltipAttribute class

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector.Attributes
[DontApplyToListElements]
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.Delegate | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter | AttributeTargets.All, AllowMultiple = false, Inherited = true)]
[Conditional("UNITY_EDITOR")]
public sealed class PropertyTooltipAttribute : Attribute, _Attribute

PropertyTooltip is used on any property, and creates tooltips for when hovering the property in the inspector.

Use this to explain the purpose, or how to use a property.

Inheritance
  • System.Object
  • System.Attribute
  • PropertyTooltipAttribute
Remarks

This is similar to Unity's UnityEngine.TooltipAttribute but can be applied to both fields and properties.

Example

The following example shows how PropertyTooltip is applied to various properties.

public class MyComponent : MonoBehaviour
{
	[PropertyTooltip("This is an int property.")]
	public int MyField;

	[ShowInInspector, PropertyTooltip("This is another int property.")]
	public int MyProperty { get; set; }
}

Constructors

PropertyTooltipAttribute(String)
Adds a tooltip to the property in the inspector.
public PropertyTooltipAttribute(string tooltip)
Parameters
System.String tooltip

The message shown in the tooltip.

Fields

Tooltip
The message shown in the tooltip.
public string Tooltip