LabelAttribute Class

Summary

[Pro-Only] Adds a label at the bottom of the default inspector to display the value of the marked property.
graph BT Type-->Base0["BaseInspectableAttribute"] click Base0 "/inspector-gadgets/api/InspectorGadgets.Attributes/BaseInspectableAttribute" Base0-->Base1["Attribute"] Type-.->Interface0["IComparable<BaseInspectableAttribute>"] Type["LabelAttribute"] class Type type-node

Syntax

[AttributeUsage(AttributeTargets.Field | AttributeTargets.Method | AttributeTargets.Property)]
public sealed class LabelAttribute : BaseInspectableAttribute, IComparable<BaseInspectableAttribute>

Attributes

Type Description
AttributeUsageAttribute

Properties

Name Value Summary
ConstantlyRepaint bool
If true, the inspector will be constantly repainted while this label is shown to keep it updated.
DisplayIndex int
If set, this inspectable will be drawn at the specified index amongst the regular serialized fields instead of after them.
HideWhenNull bool
If true, the label will be hidden when the value is null.
Label string
The label to use as a prefix before the value. If not set, it will use the name of the attributed member.
LabelContent GUIContent
The UnityEngine.GUIContent used for this inspectable's label, creates from the InspectorGadgets.Attributes.BaseInspectableAttribute.Label and InspectorGadgets.Attributes.BaseInspectableAttribute.Tooltip.
LargeMode bool
If true, the label or attributed member name will be drawn on one line with the actual value drawn below it and able to take as many lines as you want.
Tooltip string
The tooltip to use as for the label. If not set, it will use the full name of the attributed member.
When EditorState
Determines when this attribute should be active.
WhenNullable Nullable<EditorState>
Determines when this attribute should be active.

Methods

Name Value Summary
CompareTo(BaseInspectableAttribute) int
Compares the InspectorGadgets.Attributes.BaseInspectableAttribute.DisplayIndex of this inspectable to the specified `other`.