Version 3.3.1.2

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.

Disables a member based on which type of a prefab and instance it is in.

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.

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.

DisallowModificationsIn disables / grays out members, preventing modifications from being made and enables validation, providing error messages in case a modification was made prior to introducing the attribute.

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.

Tells the validation system that this member should not be validated. It will not show validation messages in the inspector, and it will not be scanned by the project validator.

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.

Force Odin to draw this value as an IMGUI-embedded UI Toolkit Visual Element.

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.

Enables a member based on which type of a prefab and instance it is.

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.

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.

Hides a member based on which type of a prefab and instance it is in.

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.

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.

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.

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.

Overrides the 'Reference Required by Default' rule to allow for null values. Has no effect if the rule is disabled. This attribute does not do anything unless you have Odin Validator and the 'Reference Required by Default' rule is enabled.

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

Makes a member required based on which type of a prefab and instance it is in.
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.

Adds a search filter that can search the children of the field or type on which it is applied. Note that this does not currently work when directly applied to dictionaries, though a search field "above" the dictionary will still search the dictionary's properties if it is searching recursively.
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.

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.

Shows a member based on which type of a prefab and instance it is in.
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.
Specifies how non-default constructors are handled.
How the square object field should be aligned.
The prefab kind returned by
Options for filtering search.
Title alignment enum used by various attributes.
Specifies the types to include based on certain criteria.
Units for use with UnitAttribute and .