Version 3.3.1.2

Odin has a dedicated attribute overview with examples

UnitAttribute class

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector.Attributes
public class UnitAttribute : Attribute, _Attribute
Inheritance
  • System.Object
  • System.Attribute
  • UnitAttribute

Constructors

UnitAttribute(Units)
Displays the number as a unit field.
public UnitAttribute(Units unit)
Parameters
Units unit

The unit of underlying value.

UnitAttribute(Units, Units)
Displays the number as a unit field.
public UnitAttribute(Units base, Units display)
Parameters
Units base

The unit of underlying value.

Units display

The unit to display the value as in the inspector.

UnitAttribute(Units, String)
Displays the number as a unit field.
public UnitAttribute(Units base, string display)
Parameters
Units base

The unit of underlying value.

System.String display

The unit to display the value as in the inspector.

UnitAttribute(String)
Displays the number as a unit field.
public UnitAttribute(string unit)
Parameters
System.String unit

The name of the underlying value.

UnitAttribute(String, Units)
Displays the number as a unit field.
public UnitAttribute(string base, Units display)
Parameters
System.String base

The unit of underlying value.

Units display

The unit to display the value as in the inspector.

UnitAttribute(String, String)
Displays the number as a unit field.
public UnitAttribute(string base, string display)
Parameters
System.String base

The unit of underlying value.

System.String display

The unit to display the value as in the inspector.

Fields

Base
The unit of underlying value.
public Units Base
BaseName
Name of the underlying unit.
public string BaseName
Display
The unit displayed in the number field.
public Units Display
DisplayAsString
If true the number field is drawn as read-only text.
public bool DisplayAsString
DisplayName
Name of the unit displayed in the number field.
public string DisplayName
ForceDisplayUnit
If true disables the option to change display unit with the right-click context menu.
public bool ForceDisplayUnit