Version 2.1.0.0

Sirenix.OdinInspector namespace

Classes

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.

The AssetSelector attribute can be used on all Unity types and will prepend a small button next to the object field that when clicked, will present the user with a dropdown of assets to select from which can be customized from the attribute.

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.

Not yet documented.

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.

The ChildGameObjectsOnly attribute can be used on Components and GameObject fields and will prepend a small button next to the object-field that will search through all child gameobjects for assignable objects and present them in a dropdown for the user to choose from.

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.

Instead of making a new attribute, and a new drawer, for a one-time thing, you can with this attribute, make a method that acts as a custom property drawer. These drawers will out of the box have support for undo/redo and multi-selection.
Delays applying changes to properties while they still being edited in the inspector. Similar to Unity's built-in Delayed attribute, but this attribute can also be applied to properties.

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.

Customize the behavior for dictionaries in the inspector.

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.

Disables a property if it is drawn within an InlineEditorAttribute.
Disables a property if it is drawn from a non-prefab asset or instance.

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.

Disables a property if it is drawn from a prefab asset.
Disables a property if it is drawn from a prefab instance.
Disables a property if it is drawn from a prefab asset or a prefab instance.

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.

Indicates that the member should not be drawn as a value reference, if it becomes a reference to another value in the tree. Beware, and use with care! This may lead to infinite draw loops!

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.

Indicates that Odin should hide the reference box, if this property would otherwise be drawn as a reference to another property, due to duplicate reference values being encountered. Note that if the value is referencing itself recursively, then the reference box will be drawn regardless of this attribute in all recursive draw calls.

The HideGroupIf is an attribute that 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.

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.

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.

Hides a property if it is drawn within an InlineEditorAttribute.
Hides a property if it is drawn from a non prefab instance or asset.

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.

Hides a property if it is drawn from a prefab asset.
Hides a property if it is drawn from a prefab instance.
Hides a property if it is drawn from a prefab instance or a prefab asset.
The HideInTables attribute is used to prevent members from showing up as columns in tables drawn using the TableListAttribute.

HideLabel is used on any property, and hides the label in the inspector.

Use this to hide the label of properties in the inspector.

Apply HideMonoScript to your class to prevent the Script property from being shown 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.

Apply HideNetworkBehaviourFields to your class to prevent the special "Network Channel" and "Network Send Interval" properties from being shown in the inspector for a NetworkBehaviour. This attribute has no effect on classes that are not derived from NetworkBehaviour.
Hides the polymorphic object-picker shown above the properties of non-Unity serialized reference types.

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.

When this attribute is added is added to another attribute, then attributes from that attribute will also be added to the property in the attribute processing step.

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.

The Inline Property is used to place the contents of a type next to the label, instead of being rendered in a foldout.

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.

Customize the behavior for lists and arrays in the inspector.

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.

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.

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

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 disabled 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.

Groups buttons into a group that will position and resize the buttons based on the amount of available layout space.

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.

A Unity Behaviour which is serialized by the Sirenix serialization system.
A Unity Component which is serialized by the Sirenix serialization system.
A Unity MonoBehaviour which is serialized by the Sirenix serialization system.
A Unity ScriptableObject which is serialized by the Sirenix serialization system.
A Unity StateMachineBehaviour which is serialized by the Sirenix serialization system.
A Unity ScriptableObject which is serialized by the Sirenix serialization system.

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.

The ShowIfGroup is an attribute that 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.

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.

Only shows a property if it is drawn within an InlineEditorAttribute.

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.

Marks a type as being specially serialized. Odin uses this attribute to check whether it should include non-Unity-serialized members in the inspector.

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.

The TableColumnWidth attribute is used to further customize the width of a column in tables drawn using the TableListAttribute.
Renders lists and arrays in the inspector as tables.
The TableMatrix attribute is used to further specify how Odin should draw two-dimensional arrays.

Title is used to make a bold header above a property.

Groups properties vertically together with a title, an optional subtitle, and an optional horizontal line.

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.

Use this with ValueDropdownAttribute to specify custom names for values.

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.

Structs

Enums

Various built-in button sizes.
Button style for methods with parameters.
Various display modes for the dictionary to draw its items.
Type of info message box. This enum matches Unity's MessageType enum which could not be used since it is located in the UnityEditor assembly.
How the InlineEditor attribute drawer should draw the object field.
How the square object field should be aligned.
Title alignment enum used by various attributes.

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.