Odin Inspector
Last updated
Last updated
BlackBox integrates with , and can display most of its attributes correctly for properties that in the BlackBox component.
Please note that when Odin is installed in your project, you will lose the ability to in all Inspectors drawn by Odin. You can still reveal properties .
First, obviously, you need to have Odin Inspector in your project. This should automatically add some scripting define symbols to your project. If you're in doubt, go to Project Settings > Player > Other settings > Scripting Define Symbols, and ensure that the symbol ODIN_INSPECTOR
is there:
By default, if you reveal a property that uses one of Odin's attributes, it will just display with its original, Unity-official property drawer. Let's assume for instance a property decorated with [RangeSlider]
:
By default, once revealed, this property would just show as a Vector2:
To ensure it displays correctly, you need to add the [RevealWithOdin]
attribute:
With it, it will automatically display as expected:
When revealing a property that is decorated with an Odin attribute, there are some things to keep in mind:
Not all attributes are supported. Especially the ones heavily modifying the layout (like [Box]
or [FoldoutGroup]
) will not work.
Odin-decorated properties don't play well with the Prefab system, and don't support nested Prefabs. This is a general Odin limitation, and something we don't have control on.
If a property is misbehaving or doesn't look correct, just remove the [RevealWithOdin]
from it to draw it again using its default Unity-provided Property Drawer.
You won't be able to reveal Odin properties by and choosing "Reveal with Blackbox". You need to find the property on the BlackBox component, by clicking the "Show Available Properties" button (as described ).
Even if you for a particular prefab, the user will always be able to Apply on Odin-decorated properties. This is unfortunately something we cannot override.