Attributes

Attributes are used to attach metadata to defined properties, similar to Decorator in scripting languages or Attribute in C#.

Attribute NameDescriptionTypeDefaultRemarks
typeRestrict the data type of the property(Any)undefinedSee type attribute
visibleShow or hide in the Inspector panelboolean[1]See visible attribute
displayNameShow as another name in the Inspector panelstringundefined-
tooltipAdd a Tooltip for a property in the Inspector panelstringundefined-
multilineUse multi-line text boxes in the Inspector panelbooleanfalse-
readonlyRead-only in the Inspector panelbooleanfalse-
minRestrict the minimum value in the Inspector panelnumberundefined-
maxRestrict the maximum value in the Inspector panelnumberundefined-
stepRestrict the step value in the Inspector panelnumberundefined-
rangeSet min, max, step[min, max, step]undefinedstep value optional
slideShow as a slider in the Inspector panelbooleanfalse-
groupShow as a tab group in the Inspector panel{ name } or { id, name, displayOrder, style }undefinedSee group attribute

The following attributes cannot be used with the get method.

Attribute NameDescriptionTypeDefaultRemarks
serializableSerialize this propertybooleantrueSee serializable attribute
formerlySerializedAsSpecify the name of the field used in the previous serializationstringundefinedDeclare this attribute when renaming the property to be compatible with the previously serialized data
editorOnlyExclude this property before exporting the projectbooleanfalse-

Other Attributes

Attribute NameDescriptionTypeDefaultRemarks
overrideDefine this parameter as true when overriding parent propertiesbooleanfalseSee override parameter

[1]: The default value of visible depends on the property name. When the property name starts with an underscore _, it is hidden by default, otherwise it is shown by default.