AssetLists is used on lists and arrays and single elements of unity types, and replaces the default list drawer with a list of all possible assets with the specified filter.
Use this to both filter and include or exclude assets from a list or an array, without navigating the project window.
AssetsOnly is used on object properties, and restricts the property to project assets, and not scene objects.
Use this when you want to ensure an object is from the project, and not from the scene.
BoxGroup is used on any property and organizes the property in a boxed group.
Use this to cleanly organize relevant values together in the inspector.
Buttons are used on functions, and allows for clickable buttons in the inspector.
ButtonGroup is used on any instance function, and adds buttons to the inspector organized into horizontal groups.
Use this to organize multiple button in a tidy horizontal group.
ColorPalette is used on any Color property, and allows for choosing colors from different definable palettes.
Use this to allow the user to choose from a set of predefined color options.
CustomContextMenu is used on any property, and adds a custom options to the context menu for the property.
Use this for when you want to add custom actions to the context menu of a property.
DetailedInfoBox is used on any property, and displays a message box that can be expanded to show more details.
Use this to convey a message to a user, and give them the option to see more details.
DisableContextMenu is used on any property and disables the context menu for that property.
Use this if you do not want the context menu to be available for a property.
DisableIf is used on any property, and can disable or enable the property in the inspector.
Use this to disable properties when they are irrelevant.
DisableInEditorMode is used on any property, and disables the property when not in play mode.
Use this when you only want a property to be editable when in play mode.
DisableInPlayMode is used on any property, and disables the property when in play mode.
Use this to prevent users from editing a property when in play mode.
DisplayAsString is used on any property, and displays a string in the inspector as text.
Use this for when you want to show a string in the inspector, but not allow for any editing.
DontApplyToListElements is used on other attributes, and indicates that those attributes should be applied only to the list, and not to the elements of the list.
Use this on attributes that should only work on a list or array property as a whole, and not on each element of the list.
DrawWithUnity can be applied to a field or property to make Odin draw it using Unity's old drawing system. Use it if you want to selectively disable Odin drawing for a particular member.
An attribute that enables GUI.
EnableIf is used on any property, and can enable or disable the property in the inspector.
Use this to enable properties when they are relevant.
Draws an enum selector in the inspector with next and previous buttons to let you cycle through the available values for the enum property.
Draws an enum in a horizontal button group instead of a dropdown.
FilePath is used on string properties, and provides an interface for file paths.
FolderPath is used on string properties, and provides an interface for directory paths.
FoldoutGroup is used on any property, and organizes properties into a foldout.
Use this to organize properties, and to allow the user to hide properties that are not relevant for them at the moment.
GUIColor is used on any property and changes the GUI color used to draw the property.
HideIf is used on any property and can hide the property in the inspector.
Use this to hide irrelevant properties based on the current state of the object.
HideIfGroup allows for showing or hiding a group of properties based on a condition.
The attribute is a group attribute and can therefore be combined with other group attributes, and even be used to show or hide entire groups.
Note that in the vast majority of cases where you simply want to be able to control the visibility of a single group, it is better to use the VisibleIf parameter that *all* group attributes have.
HideInEditorMode is used on any property, and hides the property when not in play mode.
Use this when you only want a property to only be visible play mode.
HideInPlayMode is used on any property, and hides the property when not in editor mode.
Use this when you only want a property to only be visible the editor.
HideLabel is used on any property, and hides the label in the inspector.
Use this to hide the label of properties in the inspector.
This attribute has the same effect on a single type that the global configuration option "Show Mono Script In Editor" in "Preferences -> Odin Inspector -> General -> Drawers" has globally when disabled.
HorizontalGroup is used group multiple properties horizontally in the inspector.
The width can either be specified as percentage or pixels.
All values between 0 and 1 will be treated as a percentage.
If the width is 0 the column will be automatically sized.
Margin-left and right can only be specified in pixels.
Indent is used on any property and moves the property's label to the right.
Use this to clearly organize properties in the inspector.
InfoBox is used on any property, and display a text box above the property in the inspector.
Use this to add comments or warn about the use of different properties.
The inline button adds a button to the end of a property.
InlineAttribute is used on any property or field with a type that inherits from UnityEngine.Object. This includes components and assets etc.
LabelText is used to change the labels of properties.
Use this if you want a different label than the name of the property.
LabelWidth is used to change the width of labels for properties.
MaxValue is used on primitive fields. It caps value of the field to a maximum value.
Use this to define a maximum value for the field.
Draw a special slider the user can use to specify a range between a min and a max value.
Uses a Vector2 where x is min and y is max.
MinValue is used on primitive fields. It caps value of the field to a minimum value.
Use this to define a minimum value for the field.
MultiLineProperty is used on any string property.
Use this to allow users to edit strings in a multi line textbox.
OnCollectionChanged can be put on collections, and provides an event callback when the collection is about to be changed through the inspector, and when the collection has been changed through the inspector. Additionally, it provides a CollectionChangeInfo struct containing information about the exact changes made to the collection. This attribute works for all collections with a collection resolver, amongst them arrays, lists, dictionaries, hashsets, stacks and linked lists.
The OnInspectorDispose attribute takes in an action string as an argument (typically the name of a method to be invoked, or an expression to be executed), and executes that action when the property's drawers are disposed in the inspector.
Disposing will happen at least once, when the inspector changes selection or the property tree is collected by the garbage collector, but may also happen several times before that, most often when the type of a polymorphic property changes and it refreshes its drawer setup and recreates all its children, disposing of the old setup and children.
OnInspectorGUI is used on any property, and will call the specified function whenever the inspector code is running.
Use this to create custom inspector GUI for an object.
The OnInspectorInit attribute takes in an action string as an argument (typically the name of a method to be invoked, or an expression to be executed), and executes that action when the property's drawers are initialized in the inspector.
Initialization will happen at least once during the first drawn frame of any given property, but may also happen several times later, most often when the type of a polymorphic property changes and it refreshes its drawer setup and recreates all its children.
OnStateUpdate provides an event callback when the property's state should be updated, when the StateUpdaters run on the property instance. This generally happens at least once per frame, and the callback will be invoked even when the property is not visible. This can be used to approximate custom StateUpdaters like [ShowIf] without needing to make entire attributes and StateUpdaters for one-off cases.
OnValueChanged works on properties and fields, and calls the specified function whenever the value has been changed via the inspector.
Draws a square ObjectField which renders a preview for UnityEngine.Object types. This object field also adds support for drag and drop, dragging an object to another square object field, swaps the values. If you hold down control while letting go it will replace the value, And you can control + click the object field to quickly delete the value it holds.
These object fields can also be selectively enabled and customized globally from the Odin preferences window.
Draws a horizontal progress bar based on the value of the property.
Use it for displaying a meter to indicate how full an inventory is, or to make a visual indication of a health bar.
Attribute to derive from if you wish to create a new property group type, such as box groups or tab groups.
Note that this attribute has special behaviour for "combining" several attributes into one, as one group, may be declared across attributes in several members, completely out of order. See CombineValuesWith(PropertyGroupAttribute).
PropertyOrder is used on any property, and allows for ordering of properties.
Use this to define in which order your properties are shown.
PropertyRange attribute creates a slider control to set the value of a property to between the specified range.
This is equivalent to Unity's Range attribute, but this attribute can be applied to both fields and property.
The PropertySpace attribute have the same function as Unity's existing Space attribute, but can be applied anywhere as opposed to just fields.
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.
ReadOnly is used on any property, and prevents the property from being changed in the inspector.
Use this for when you want to see the value of a property in the inspector, but don't want it to be changed.
Required is used on any object property, and draws a message in the inspector if the property is missing.
Use this to clearly mark fields as necessary to the object.
SceneObjectsOnly is used on object properties, and restricts the property to scene objects, and not project assets.
Use this when you want to ensure an object is a scene object, and not from a project asset.
ShowDrawerChain lists all prepend, append and value drawers being used in the inspector. This is great in situations where you want to debug, and want to know which drawers might be involved in drawing the property.
Your own custom drawers are highlighted with a green label.
Drawers, that have not been called during the draw chain, will be greyed out in the inspector to make it clear which drawers have had an effect on the properties.
ShowIf is used on any property and can hide the property in the inspector.
Use this to hide irrelevant properties based on the current state of the object.
ShowIfGroup allows for showing or hiding a group of properties based on a condition.
The attribute is a group attribute and can therefore be combined with other group attributes, and even be used to show or hide entire groups.
Note that in the vast majority of cases where you simply want to be able to control the visibility of a single group, it is better to use the VisibleIf parameter that *all* group attributes have.
ShowInInspector is used on any member, and shows the value in the inspector. Note that the value being shown due to this attribute DOES NOT mean that the value is being serialized.
ShowPropertyResolver shows the property resolver responsible for bringing the member into the property tree. This is useful in situations where you want to debug why a particular member that is normally not shown in the inspector suddenly is.
The SuffixLabel attribute draws a label at the end of a property.
Use this for conveying intend about a property. Is the distance measured in meters, kilometers, or in light years?. Is the angle measured in degrees or radians? Using SuffixLabel, you can place a neat label at the end of a property, to clearly show how the the property is used.
SuppressInvalidAttributeError is used on members to suppress the inspector error message you get when applying an attribute to a value that it's not supposed to work on.
This can be very useful for applying attributes to generic parameter values, when it only applies to some of the possible types that the value might become.
TabGroup is used on any property, and organizes properties into different tabs.
Use this to organize different value to make a clean and easy to use inspector.
Title is used to make a bold header above a property.
Toggle is used on any field or property, and allows to enable or disable the property in the inspector.
Use this to create a property that can be turned off or on.
ToggleGroup is used on any field, and create a toggleable group of options.
Use this to create options that can be enabled or disabled.
Draws the checkbox before the label instead of after.
The TypeInfoBox attribute adds an info box to the very top of a type in the inspector.
Use this to add an info box to the top of a class in the inspector, without having to use neither the PropertyOrder nor the OnInspectorGUI attribute.
ValidateInput is used on any property, and allows to validate input from inspector.
Use this to enforce correct values.
ValueDropdown is used on any property and creates a dropdown with configurable options.
Use this to give the user a specific set of options to select from.
VerticalGroup is used to gather properties together in a vertical group in the inspector.
This doesn't do much in and of itself, but in combination with other groups, such as HorizontalGroupAttribute it can be very useful.
Wrap is used on most primitive property, and allows for wrapping the value when it goes out of the defined range.
Use this when you want a value that goes around in circle, like for example an angle.