Version 2.1.0.0

Odin has a dedicated attribute overview with examples

LabelTextAttribute 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)]
public class LabelTextAttribute : Attribute, _Attribute

LabelText is used to change the labels of properties.

Use this if you want a different label than the name of the property.

Inheritance
  • System.Object
  • System.Attribute
  • LabelTextAttribute
Example

The following example shows how LabelText is applied to a few property fields.

public MyComponent : MonoBehaviour
{
	[LabelText("1")]
	public int MyInt1;

	[LabelText("2")]
	public int MyInt2;

	[LabelText("3")]
	public int MyInt3;
}
See Also

Constructors

LabelTextAttribute(String)
Give a property a custom label.
public LabelTextAttribute(string text)
Parameters
System.String text

The new text of the label.

Fields

Text
The new text of the label.
public string Text

This website is brand new and built with the Odin 2.1 beta in mind. This means you might discover some features such as attribute expressions that are only available in the beta.

You can download the 2.1 beta from here and read the patch-notes here.