It's important to know that Odins SerializedMonoBehaviours do still not fully support Unity's new nested prefab system.
This does not affect the serializer and SerializedScriptableObjects and the serializer, in general, is solid as a rock.
But prefab modifications made to Odin-serialized data inside of SerializedMonoBehaviours currently only support one layer of prefab modifications.
The UI for Odin-serialized values will be disabled when there is more than one potential layer of modifications,
as they cannot be safely edited in that case; a warning will be shown to explain this when it applies.
Odin now deals with the fact that as of Unity 2018.3, outside references to components of prefab assets becomes "fake null" when changes are made to the given prefab asset.
When this happens Odin will display a regular object field of a valid object wrapper, gotten from the AssetDatabase,
along with a small button that opens up a dialog, where you fix the temporary issue in various ways.
Note that triggering an Assembly reload, by entering or play-mode or recompile, also fixes the broken object wrapper.
All networking references that are no longer available in 2019, has been moved out of the assemblies, an into standalone script files, which are disabled in Unity 2019+
Added [HideDuplicateReferenceBox] attribute, to hide the wrapping reference box that appears when the same object reference is drawn twice.
Added IDataWriter.GetDataDump() and IDataReader.GetDataDump() methods, which gets a string data dump of what the reader/writer is currently working with, for debug logging purposes. Also added implementations for this in the Binary, Json and Node data reader/writers.
Components will now explicitly be marked as dirty by the RegisterUnityObjectDirty method.
Delayed and DelayedProperty attributes should now draw fields the same way.
Marked IDataWriter.Stream and IDataReader.Stream obsolete.
Moved SyncVarAttribute and SyncList drawer out from precompiled project to plugin folder as script files.
PropertySpace no longer draws 8 pixels of space when the SpaceBefore property is set to 0. This was implemented to replicate the behaviour of Unity's Space attribute.
The SuppressInvalidAttributeError attribute is now propogated to all children of a property.
Added GUIAlwaysEnabled option to InfoBox attribute.
Expanded Tools > Odin Inspector > Help to Tools > Odin Inspector > Help > Discord, Report An Issue and Contact.
Various places in the code that log errors no longer throw exceptions when the reader/writer has no stream, but instead log the full data dump. This will greatly help with reproduction in case of invalid reading of data/corrupt data.
Created a fix for an issue with prefab references turning being destroyed and showing as null in the inspector when the referenced prefab asset is modified in 2018.3 and above. Odin can now automatically (or case-by-case) detect and fix these broken references.
Dictionary now adds copies of the value to add to the actual dictionary, meaning the same reference will not be added repeatedly if you are working with reference type keys.
Fix to PrefabModificationHandler directly calling Unity prefab APIs that are obsolete in the new 2018.3 prefab workflow - it now properly uses Odin's prefab utilities that handle this case properly.
Fixed a bug where RenderTextures wouldn't be rendered properly in PreviewField.
Fixed an issue where SirenixEditorFields.UnityPreviewObjectField wouldn't ping a prefab referenced by a component. https://bitbucket.org/sirenix/odin-inspector/issues/459/unitypreviewobjectfield-not-highlighting.
Fixed an issue where using the Required attribute a value type would result in nothing being drawn in the inspector: https://bitbucket.org/sirenix/odin-inspector/issues/473/enum-dropdown-not-being-displayed.
Fixed an issue where when using structs with bool fields for Dictionary keys, the inspector would display an 'Invalid use of DelayedAttribute' error message.
Fixed an issue with the EnumToggleButtons attribute where 0 values in flag enums would always be displayed as on. You can now also click the 0 value button to clear the entire enum value.
Fixed eternal loop in FolderPath attribute when right-clicking folder that doesn't exist.
Fixed NullReferenceException in DictionaryDrawer.
The AOT support scan now skips editor-only Resource assets.
Odin Inspector Version 2.0.13
SirenixEditorFields.DelayedIntField now works the same as other Delayed- fields in the SirenixEditorFields class.
Odin Inspector Version 2.0.12
Added a DoNotDrawAsReference attribute to indicate that you do not want Odin to treat a given property as being a reference to another property.
Added an error message to the source code for when Odin is compiled as source code in Unity with .NET Standard 2.0 API compatibility level.
Added ResizableColumn GUI API.
Added Transpose example to TableMatrixExamples in the demo scene.
Added an UnityGameObjectIcon to EditorIcons.
Better undo names when changing values in the inspector.
Delayed and DelayedProperty attributes now gets applied to a struct now get applied to all members of the struct as well.
Delayed fields in SirenixEditorFields now only sets GUI.changed to true when the delayed value is applied.
Providing an OdinEditorWindows array of objects for displaying now lets you multi-edit all of the objects at once.
Fixed a bug where modifying dictionary key values of certain types in the inspector, would in some cases apply the temporary value returned from the control before the user had confirmed the new value. This would in some cases cause the user to modify multiple different keys unknowingly.
Fixed a layout issue with minimum width on fields with the Delayed or the DelayedProperty attribute.
Added the '+' character to list of allowed special character keys in Dictionary key paths.
Odin Inspector Version 2.0.11
Added Transpose option to [TableMatrix] for 2D arrays, which flips them so they match the C# code declaration layout in the inspector.
Added RespectIndentLevel argument to [TableMatrix] with the default value of true, to indicate whether the table should respect the current GUI indent level.
[LabelText] attribute has been reverted back to pre-2.0.10 behaviour, where it in fact does override labels passed down by InspectorProperty.Draw(GUIContent label) calls.
Renamed label argument of InspectorProperty.Draw overload to defaultLabel, and changed the documentation of the method, to emphasize that the label passed down will not necessarily be used by the actual drawers.
Fixed a bug where cells in two-dimensional tables would be individually indented by the current indent level.
Fixed a bug where two dimensional tabels would as a whole would not respect the current indent level.
Fixed issue introduced in 2.0.10, where Unity-serialized members would always have all child members that Odin would have serialized, were it serialized by Odin, shown by default as if they had [ShowInInspector] on them.
Fixed possible flaws with object dirtying when clicking buttons, and when adding to lists using CustomAddFunction.
Fixed potential thread hang in AssemblyUtilities when assemblies are stuck in the queue after initial loading.
Odin Inspector Version 2.0.10
Fixed the "Unable to find style 'IN Popup' in skin 'LightSkin' repaint" warning in 2018.3b.
Fixed an issue where the TypeFilter attribute did not work on unordered collections such as HashSets and Stacks.
Selecting elements from the TypeFitler now only requires a single mouse click, and it also longer enables multi-selection when adding items to a list which was never the intention.
The [LabelText] attribute no longer overrides labels that are passed down to the drawer chain using the Draw(GUIContent label) overload, and no longer changes the actual label of the InspectorProperty itself but merely passes its own label further down the chain.
The InternalOnInspectorGUI will no longer show up as a column when you use the TableList attribute together with a list of SerializedScriptableObjects.
Odin Inspector Version 2.0.9
AssemblyUtilities async initialization thread failing to start is now handled properly, and allowed, as the thread is not necessary. This fixes initialization on WebGL.
Fixed issue where properties with no serialization backend (for example, properties that were shown using [ShowInInspector]) would by default have no child properties.
They now have the child properties that they would have had if Odin were serializing them, but those children are still assigned a serialization backend of None.
Made OdinPropertyProcessorLocator and ProcessedMemberPropertyResolverExtensions.ProcessingOwnerType public instead of internal.
Odin Inspector Version 2.0.8
Fix to new serialization backend guessing logic, which in one spot failed to check whether Odin serialization was present on a given Unity object before making its guess, resulting in Odin-serializable properties showing up as Odin-serialized even if Odin was not serializing the Unity object at all.
Odin Inspector Version 2.0.7
PropertyTree.ApplyChanges() is now invoked at the beginning of PropertyTree.UpdateTree(), meaning that value changes set in events outside of the main IMGUI loop will no longer be lost. It should now almost never be necessary to manually call ApplyChanges() on changed value entries.
Simplified and improved default logic for determining serialization backend and visibility of members in the inspector.
Clicking the Add button on Dictionaries now also expands the dictionary itself, clicking it again will only hide the AddKey dialog.
Collapsing a dictionary by clicking on the foldout label now also hides the Add button dialog if it's visible.
Fixed a bug where dictionaries drawn using the DictionaryDisplayOptions.Foldout mode would sometimes cause foldout key labels to overlap with the key values.
Fixed a bug where the paging buttons on TableLists wouldn't appear when both AlwaysExpanded and ShowPaging was set to true.
Fixed a bug where the preview of AnimationCurve would sometimes not update when forinstance reordering elements in a list.
Fixed case where keys and values in dictionaries could have the wrong serialization backend guessed by the inspector, sometimes leading to odd behaviour. They should now always inherit the exact backend of the containing dictionary.
Legacy Unity drawing being broken now also triggers a notifying error message in Unity versions above 2017.1. The error message has also been improved.
Odin now throws an exception with a useful message instead of triggering a stack overflow when property members that are dependent on the property's children being initialized are queried while those children are being initialized.
DefaultSerializationBinder now has far better support for parsing generic type names.
DefaultSerializationBinder now properly handles array typenames in all fallback cases. This means better support for moving serialized types between assemblies, such as when porting your project to Unity's .asmdef system.
Fixed external string and guid reference reading being broken when deserializing json.
The AOT scan now also scans all asset bundles in the project for types to support.
Fixed error in JsonDataReader that would cause an infinite loop when reading a primitive array when the parameter-less constructor is called.
Odin Inspector Version 2.0.6
Vastly decreased startup and initialization times throughout Odin resulting in noticeably faster recompilation times in Unity.
Memoized AssemblyUtilities.IsDynamic, resulting in a huge speed-up to many reflection-based initialization routines. Odin's impact on reloads/recompiles should now be significantly smaller.
AssemblyUtilities initialization is now async and the class has been made thread safe.
GUIPagingHelper now removes GUI focus when changing page.
PropertyTree.ApplyChanges() now automatically marks all changed objects/their scenes dirty as appropriate, as the set of objects that might have to be marked dirty is no longer strictly limited to the tree roots.
PropertyTrees are no longer implicitly limited to only inspecting the "tree root" Unity objects, but will correctly handle inspecting Unity objects that are nested as part of the same property tree, including dirtying, figuring out the proper serialization backend for properties, and so on. Properties no longer assume that the tree root is also their serialization root.
The Generic Menu Example in Custom Drawer Examples is now up to date.
Added InspectorProperty.SerializationRoot to facilitate a single property tree inspecting nested Unity object values. A property's SerializationRoot is the property that "owns" the serialization of said property, and is not necessarily the inspected tree root.
Added IOverridesSerializationPolicy interface, which can override the serialization policy of an Odin-serialized Unity object, and whether it serializes Unity-serialized fields. The inspector and the serialization debugger will respect this policy override and use it to determine member serialization.
Values whose children have prefab modifications applied now also have a "Revert to prefab value" context menu option, which reverts the value and all its children to the prefab value.
Changing values can no longer mark all scenes as dirty if the inspected target is a ScriptableObject or an EditorWindow.
Editing of type entries in the AOT Generation preferences is no longer broken, and has been reworked a bit for higher reliability.
Fixed a bug where scrolling in scroll-views could cause rows rendered using the TableList attribute to show up blank.
Fixed a bug where TableLists would use scroll events when no scroll-view was visible, preventing users from scrolling in the outer scroll area while hovering the table.
Fixed a null reference exception when calling IPropertyValueEntry.ApplyChanges from outside an IMGUI context.
Fixed AssemblyUtilities lookup by full type name for nested types.
Fixed case where group attributes in derived classes would sometimes affect group attributes in base classes due to complex caching optimizations.
Fixed case where InspectorProperty.SupportsPrefabModifications would be constantly recalculated for no reason in certain situations.
Fixed case where some registered legacy Unity property drawers such as ExposedReferencePropertyDrawer, would not be matched correctly to their drawn types by Odin, causing for example ExposedReference<T> to be drawn incorrectly in the inspector.
Fixed error where the CollectionDrawer would be used instead of the DictionaryDrawer in source mode, causing dictionary drawing and usage to be broken.
Vector2/3Int xyz value serialization backend is now correctly determined by Odin, through new property resolvers. This fixes issue #447 where prefab modifications would not work property when changing xyz on Odin-serialized Vector2/3Int values.
Odin Inspector Version 2.0.5
The getting started guide now display disabled buttons that will become enabled after its packages has been imported.
Fixed an issue introduced with disposable property-trees in 2.0.4 where OdinEditor.OnDestroy would take longer time than necessary causing unwanted delays when browsing through GameObjects in the hierarchy that had a lot of components rendered with Odin.
Fixed errant PrefabUtility.GetPrefabParent reference in PrefabModificationHandler, replaced with reflection-based wrapping API call instead.
Fixed case where the AOT scanner would not scan any disabled game objects in scenes, meaning it would sometimes miss types that should be supported.
Fixed case where the AOT scanner would not scan any disabled game objects in scenes, meaning it would sometimes miss types that should be supported.
Odin Inspector Version 2.0.4
Improved support for 2018.3 Beta. All editor functionality works, but for those using Odin Serialization, be aware that Odin-serialized values will become disabled for modification
when you have more than one potential layer of modifications, such as having prefab variants of prefab variants, or variants nested in prefabs, and so forth.
We're still working on this and will keep you updated on our road-map and in the patch notes when we have more news.
The EnumSelector will now show all members of an enum, regardless of whether they are obsolete or a member with the same value already has been shown.
The EnumSelector now also display obsolete messages in the selector when you mouse over an enum member marked with the Obsolete attribute.
HideInInspector, InfoBox, and LabelText, now also works on enum members.
Added TypeExtensions.AreGenericConstraintsSatisfiedBy overload that checks constraints for a MethodInfo.
The PropertyContextMenuDrawer should now be skipped in the drawer chain when the context menu has been disabled by the DisableContextMenu attribute.
Fixed a bug where the ValueDropdown attribute would assign null values to members, resulting in errors in the console when clicking on folders with no values assigned in the drop-down.
Fixed an issue where a drawer would get a wrong PropertyContext instance when calling Property.Context.Get in IDefinesGenericMenuItems.PopulateGenericMenu.
Fixed an issue where the context menu would not appear when an AssetList was right-clicked.
Fixed bug introduced in Odin 2.0.2, where property trees were made disposable, where a property whole type is changing will have OnValueChanged subscriptions cleared before they are invoked for the new value.
Fixed case where the warning stating that prefab instance modifications are not supported on a given property, would not show up if that property had a group as a direct parent.
Fixed case where TypeExtensions.GetAllMembers did not return the members of the System.Object class.
Fixed exception in FolderPathAttributeDrawer when the value was null.
Fixed an issue where ReadOnly attributes added or removed by OdinAttributeProcessors would be ignored.
Fixed reflection of internal Unity field SerializedObject.m_Property to SerializedObject.m_NativeObjectPtr in 2018.3, which was causing a warning message to appear.
Fixed some group members not showing up in TitleGroupExamples.
GUIHelper.PushContentColor now pushes the current GUI.contentColor to the stack instead of the current value of GUI.color.
OdinPrefabUtility.UpdatePrefabInstancePropertyModifications now works properly again for registering modifications to collections and dictionaries.
Removed internal debugging fields that caused warnings in source mode.
Various fixes to automatic registering of necessary prefab modifications.
Odin Inspector Version 2.0.3
Fixed an issue where the inner scroll-view for TableLists would become fully expanded after expanding them a second time.
Odin Inspector Version 2.0.2
The FuzzySearch class have been overhauled and is now a lot faster.
The PropertyTree, InspectorProperty, and PropertyValueEntry classes are now disposable. When a tree is disposed of, all disposable drawers, resolvers, processors, and locators will be disposed. A tree that is not disposed manually will be disposed when it is garbage collected. That is, it is now guaranteed that Dispose will be called on all disposable things in the tree before they are garbage collected, so it is now possible to safely use resources in drawers that will need to be destroyed/disposed once the drawing is done.
OdinMenuItems.IsVisible is now marked obsolete and no longer does anything. This concept which was previously used for filtering search results. Instead, search results are cached to separate list stored in OdinMenuTree's in order to support sorting.
Invoking buttons now longer throws an ExitGUIException. #402
The Required attribute no longer gives the error "Value types cannot be null, and thus cannot be marked as required." when used on value-types. #405
Added GetLocal methods to PersistentContext class.
Added UnityEditorEventUtility.DelayActionThreadSafe, to safely delay actions that should start Unity's thread, from other threads.
Fixed an issue where some letters would be cut off in Title and TitleGroup attribute's subtitles.
Fixed an issue where using something like HorizontalGroup.Padding = 0.2 would result in a layout error in the first GUI frame.
Fixed an issue where FuzzySearch would fail to match "Trigger" to "tTrigger". #386
Fixed an issue ListDrawerSettings.IsReadOnly would not hide the add and remove buttons.
Fixed a bug where the property-context-menu wouldn't show up for disabled elements in the inspector.
Fixed a bug where the Responsive Vector Component configuration in the Odin preferences window would not reset to default.
ValueDropDownLists with null entries no longer throws an ArgumentNullException. #400
Clicking the triangle on OdinMenuItems now no longer selects the menu item, and only toggles the isExpanded state. Holding alt, now also expand or collapses all child menu items. #409
EnableSingleClickToSelect no longer changes unnecessary GUI.changed states which populates the undo stack. #409
OdinPropertyTrees are now disposable and invoked properly throughout Odin. The InlineEditorAttributeDrawer now implements the disposable and ensures all created editors are destroyed instead of only destroying them on selection changed.
Fixed various TableList layout related bugs.
The DetailedInfoBox attribute is no longer shows the detailed message in its initial state.
The DefaultMethodDrawer no longer throws any ExitGUIExceptions.
Odin Inspector Version 2.0.1
Fixed a bug where the HorizontalGroup attribute with a specified Margin or Padding would yield a layout error in the console.
Fixed an issue on ProgressBarField overlay text where a different style was used for calculating label size from the one that was used for drawing the text. This resulted in alignment issues with right aligned overlay text. #377.
You can no longer accidentally remove a value from a HashSet by setting an existing value in the HashSet on a different index, thereby "duplicating" and deleting it. This fixes an issue with enums where setting an enum value on a HashSet would in many cases mysteriously delete entries in the HashSet.
Fix an issue where GUIHelper.GetAssetThumbnails would in some cases throw a NullReferenceException thrown from UnityEditor.AssetPreview.GetTypeMiniThumbnail.
Fixed an issue where string properties would be handled as references by the If attributes, and would, therefore, ignore the comparison value.
We've now also got an online roadmap. And finally, as you may know, we've open sourced the Odin Serializer.
As a final remark for people wondering about the version number, this patch was initially intended to be the 1.1 patch, but this was the perfect opportunity to convert to a simpler versioning system that goes: breaking.features.fixes.internal.
This patch has been in beta for quite a while, so a huge thanks to our community for all the testing, support and patience!
Upgrade / Install notes
Import the package Make sure that your Unity Editor is signed in to your Asset Store account. Otherwise, it'll import the previously downloaded version of Odin.
Click yes To upgrade Odin, import the package and press "I Made a Backup, Go Ahead!" when the API Updater pops up.
Done Note that if you've set custom assembly import settings for our DLL files, you will have to do this again.
When Odin is done importing you'll see the new Getting Started popup, which now gives you a better overview of all new and existing example projects.
The getting started guide is now always available from Tools > Odin Inspector > Getting Started.
Finally, if you experience any issues or inconveniences, be sure to submit it on our issue-tracker or come join us on Discord.
To everyone experiencing Unity's object picker bug in Unity 2018.2 from older versions of Odin.
In Unity version 2018.2, Unity's object-picker has become somewhat fragile and can in cases
become permanently broken until specific steps have been taken.
Unity is already on it,
but until then, here are some steps you can take to get rid of the problem:
Import Odin Inspector 2.0
Reset the Editor window layout: Window > Layouts > Default
Trigger an assembly reload by pressing play or restarting Unity
After this, everything should be back to normal. Other plugins can still cause the error so if
it happens again; we suggest downgrading to 2018.1 until Unity has fixed the issue.
Major Performance Improvements
Odin no longer cares how much data you throw at it, it�ll now render objects with millions of entries smoothly, without any instantiation lag.
To do this, we�ve added a new lazy property resolution system, Odin Property Resolvers, which not only makes
adding support for stacks, queues, linked lists and so on a breeze but also vastly increases performance, as all property resolvers are lazily evaluated.
Along with a ton of other performance improvements, this means that Odin editors now run a lot smoother.
We have also increased the performance of the Serializer's binary formatter by about 30%.
New Static Inspector Utility
If you're a programmer or a brave designer, then you're likely going find the static inspector helpful during debugging and testing.
The new static inspector lets you select any type, and see all of its static members.
You can open multiple instances of the static inspector from Tools > Odin Inspector > Static Inspector.
Show Static Members in the Inspector
The [ShowInInspector] attribute can now be placed on any static members. This lets you inspect any static member where ever you find them.
And, of course, you can also use any of Odin's existing attributes to add functionality, decorate and group your static properties as well.
Finally, note that this does not mean that static members are being serialized. Odin will never serialize your static members.
Show Buttons with Parameters
The Button attribute can now be placed upon methods that contain parameters, which can now be input in the inspector. To accompany this, we've added a new overload to the
Button attribute which lets you customise the look of the button when it includes parameters.
Default parameter values for optional parameters are transferred to the inspector, and methods with ref and out parameters get
updated in the inspector when the method is invoked and changes those values.
Put Attributes on Classes Instead of Member
Instead of adding the same attribute, again and again, It is now possible to put attributes on top of types, which will result in the given attribute being applied to all members of that type.
Improved TableList Attribute
The TableList attribute has gotten a lot of new improvements, including better performance, better column resizing,
and it now also boasts new features such as scroll-views with fixed column headers.
The TableList and TableColumnWidth attribute have also gotten a few new options such as ShowIndexLabels, whether to draw a scroll view or use paging
and toggling whether a column should be resizable or not.
Scroll views are now the new default for TableLists but it can be customized globally in Tools > Odin Inspector > Preferences > General > Collections.
Finally, the TableList attribute can now be placed on collections of ScriptableObjects, and it will show their members as columns.
Imagine populating a list with all of your scriptable objects of a certain type, putting on a TableList attribute, and having that list shown in an OdinEditorWindow!
New InlineEditor Attribute Features
The InlineEditor attribute has also gotten a couple of new features to cover a wider range of use cases.
It now has several options that let you display the inline editor without showing the object field, including a way
to render the object field in a foldout.
Lots of new Features added to the ValueDropdown Attribute
We've added a lot of new features to the ValueDropdown attribute. Not only do you now have a lot of control over
how the dropdown itself is presented, which features it should have, and how it's used -
it now also works smoothly together with lists where it now presents a drop-down when users click the add button.
In addition to that, it can now also display both the drop-down and its children. See the attributes overview demoscene
and the online ValueDropdown API Documentation for more examples.
Automatic Assembly Import Settings Tool
To fully utilize Odin's serialization features, it is necessary to have to correct import settings on our serialization DLLs.
Out of the box, Odin comes preconfigured correctly for the most commonly used platforms and build settings,
but it has not been possible to cover every single use case using just Unity's import settings metadata in a preconfigured manner.
This has led to a lot of questions and confusion when building games that rely upon the Odin Serializer, particularly when using IL2CPP on Android and Standalone platforms.
With 2.0 we are introducing a new tool to solve this issue, that lets you change the import settings both manually and automatically.
If you go to Tools > Odin Inspector > Preferences, you will find these features in the new Import Settings preferences.
From here you can enable or disable the automating import settings build preprocess step that should ensure that Odin just works when you hit the build button.
The automation feature only works from Unity 5.6 and up, but you can also manually change the import settings from here.
The Import Settings window will even show you the recommended settings based upon your currently active build configuration.
The TypeFilter attribute lets you control exactly which types a given member can contain. It will also draw all child members in a foldout below the drop-down.
The EnableGUI attribute does exactly what one might think; if the GUI appears disabled in the inspector, for instance, if a property doesn't have a setter,
then you can use this attribute to enable it anyways.
The PropertySpace attribute has the same function as Unity's existing Space attribute, but can be applied on methods and properties as well.
It also lets you add space both before and after the property.
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 does not affect classes that are not derived from NetworkBehaviour.
You can now take complete control over how Odin finds its members to display and which attributes to put on those members.
This can be extremely useful for automating editor creation and providing support for third-party libraries you don't own the code for,
or simply keeping your classes clean of attributes.
Check out the new example scene from the Getting Started guide inside of Unity to learn more.
Introducing Property Processors
You can now take complete control over Odin's property system to inject, remove and modify properties programmatically without ever
touching the source code of your components. In a sense, this is the step up from Attribute Processors, giving you total and complete
control over the inspectors of anything rendered by Odin, including third-party libraries you don't own the code for.
We've made a huge optimization pass, resulting in a further property system speedup apart from the system rebuild towards lazy property resolution.
Changes made are too numerous to list exhaustively, but overall the property system should now be 3-20x faster depending on the situation, even without taking
lazy property resolution into account. Property initialization garbage allocation is now about 1/8th of what it used to be before this patch.
The group system no longer processes groups for members with 0 children.
EmitUtilities now caches created fast getter/setters per member, making it far faster overall.
Generic inferral/constraints checking methods should now allocate far less garbage and be a little bit faster.
InspectorPropertyInfo.CreateForMember is now significantly faster.
PropertyContextContainer now allocates no context dictionaries before they are actually needed.
Improved performance of OdinMenuEditorWindows.
CompositeDrawer, which draws most types, no longer makes any dictionary lookups, which slowed down the inspector.
OdinMenuTrees now renders a lot faster by only drawing visible MenuItems.
PropertyContextMenuDrawers no longer do any context/dictionary lookups, improving performance quite a lot.
Reduced the size of the property draw call-stack.
Improved performance of various fields in SirenixEditorGUI.
Significant performance improvements to rendering prefab instances with many modifications in the inspector.
Added support for Unity 2018.2.
HashSet<T>, Queue<T>, Stack<T> as well as all ICollection<T> derived types (IE, LinkedList<T>, for example) are now fully supported in the inspector, with drag and drop reordering where applicable.
Added much requested CustomRemoveIndexFunction and CustomRemoveElementFunction to the ListDrawerSettings attribute. Either function can be used to reference a method that will be called when the remove button is pressed on a collection drawer and can be used to implement custom collection item removal logic.
The MinMaxSlider attribute now also works on Vector2Int properties.
Added HideToolbar option to the TableList attribute.
Added proper support for delegate-only properties that are not backed by concrete method members.
Added support to PropertyTree for inspecting types statically without instances via PropertyTree.CreateStatic(Type type).
Added TypeDefinitionAttributesProcessor to allow for adding attributes to type definitions that get applied to fields and properties of that type.
Added new overload to the GUIColor attribute which lets you specify the name of a local member that returns the color to be used.
Implemented HideRemoveButton in the ListDrawerSettings attribute that hides the remove button from list elements in the inspector.
MinMaxSlider attribute now supports specifying a member to dynamically retrieve the min and max value.
ProgressBar attribute now supports specifying a member to dynamically retrieve the min and max value.
PropertyRange attribute now supports specifying a member to dynamically retrieve the min and max value.
A style can now be passed to EnumSelector<EnumType>.DrawEnumSelector().
Added HideNamespace and FlattenTree parameters to OdinSelector which can be toggled on to make the tree a bit more clean for simple use cases.
Added a new feature to GUIPaging, that lets you draw the most common GUIPaging controls.
Added a new Foldout overload in SirenixEditorGUI that gives you the ValueRect if you need to draw something next to it.
Added a new method to drawers called GetPersistentValue<T> which lets you have persistent GUI state across recompiles and Unity sessions.
Added a new PageSlideNavigation, for creating tutorial and wizard-like windows.
Added a new virtual method to OdinEditorWindows named DrawEditors that calls DrawEditor(index) for each of the currently drawing targets.
Added a reset to default button in GeneralDrawerSettings.
Added AttributeListExtensions which defines useful utility methods for manipulating lists of attributes. These are intended for use in custom AttributeProcessors.
Added CurrentlyDraggingId, CurrentlyHoveringDropZoneId to DragAndDropUtilities.
Added DefaultLabelStyle and SelectedLabelStyle to OdinMenuStyle.
Added DrawThickHorizontalSeperator to SirenixEditorGUI.
Added EditorIcons.Pause icon.
Added menuTree.Config.UseCachedExpandedStates that when enabled will try and restore the expanded state of OdinMenuItems. You can disable this feature for a boost in performance.
Added more overloads to make it easier to add sprites to OdinMenuItems.
Added new overload to OdinSelector.ShowInPopup that simply takes the rect of a button.
Added OdinDrawer.SkipWhenDrawing, which causes the drawer to be skipped over when iterating the drawer chain.
Added OdinInspectorLogo icon to EditorIcons.
Added OdinMenuTree.ActiveMenuTree which now indicates which menu tree is active. Navigating the menu tree with the keyboard will now only navigate the active OdinMenuTree. Selected OdinMenuItems in inactive OdinMenuTree's will be with a grey background. https://jumpshare.com/v/PtUOvkuKXmCNv3WGzi3r.
Added options for filling in instances of OdinAttributeResolverLocator and OdinPropertyResolverLocator to PropertyTree.Create.
Added overload to EnumSelector.DrawEnumField that lets you specify the content label.
Added PropertyTree.AttributeProcessorLocator, PropertyTree.PropertyResolverLocator and PropertyTree.DrawerChainLocator, which can be used to inject custom logic to take control of almost any part of the property system.
Added ShowPropertyResolverAttribute which will let you debug which property resolver is being used to resolve a property.
Added SirenixEditorGUI.GetFeatureRichControlRect which helps with implementing practices for making new editor controls.
Added UnitySerializationUtility.HasModificationsWaitingForDelayedApply to accomodate the prefab modification crash fix.
Added various MenuItemsCollections.AddIcons overloads.
AddThumbnailIcons to collections of menu items now also works with asset paths.
Calling OdinEditorWindow.InspectObjectInDropDown now automatically continuously adjust the height of the window.
DragAndDrop utilities now respects EditorGUI.showMixedValue.
EnumSelector<EnumType>.DrawEnumSelector() can now be called with a custom rect.
GenericSelector now has a new overload which lets you associate a value name directly.
Implemented SirenixEditorGUI.BeginLegendBox and SirenixEditorGUI.EndLegendBox methods.
InspectorPropertyValueGetter now exposes the MemberInfo it found.
Paging on tables now uses the new GUIPaging utilities, which also enables a slide zone where you can slide back and forth between pages.
The button to expand the list will no longer be drawn if the list contains more than 300 elements.
Added a IconGetter Func to OdinMenuItems, utilized by extension methods such ash menuItems.AddIcons<MyType>(x => x.Icon). This also fixes the bug where Icons
for various menu items would sometimes disappear because of Unity's internal asset preview icon cache size.
Added ShowInInspector attribute to the ButtonGroup attribute.
MASSIVE DRAWER REFACTOR: Drawers now have a this.Property, this.ValueEntry and this.Attribute where appropriate. All methods that passed these values as parameters earlier are now obsolete. InspectorUtilities.DrawProperty is now obsolete; use property.Draw instead. All CallNextDrawer overloads apart from a new one that takes only a label are now obsolete. Refactored all Odin drawers to match this.
The ShowInInspector attribute should now always overrule the HideInInspector attribute.
Adding and deleting properties in collections now recreates all properties in the collection, to ensure instanced drawers gets recreated for the new values.
Added check to see if there is a default constructor in MatchableOdinAttributeResolverLocator.
Added constructor overload to the PropertyGroups that doesn't take an orderId.
All box headers and toolbars are now a bit smaller in height.
All delayed fields are now drawn in yellow while the delayed value has not yet been applied (press 'enter' to apply the value).
Almost all properties on all of Odin's attributes now have public setters, which means they can now be dynamically created and changed in attribute resolvers.
All Odin Context menus throughout Unity are now all defined in one file called OdinUnityContextMenuItems.cs.
Attributes added to an attribute will now be also be added to a property if the attribute has a IncludeMyAttributes attribute.
Auto AOT generation should now only process scenes that have been added to the build settings.
BoxGroup will now always draw a header unless ShowLabel has been set to false.
Changed all public properties of Odin's attributes to be public fields instead.
Changed drawer priority of Odin's UnityEventDrawer from (0, 0, 1) to (0, 0, 0.99).
Changed the default value for ExpandListsByDefault from true to false.
The Odin preferences window now sports an Odin logo in the title.
CharDrawer no longer uses a delayed text field, which was confusing.
Downgraded serialization error when a reference type node is missing an ID to a warning, as this can legitimately happen in many cases - such as when a type serialized as a struct has changed to a class before deserialization.
Improved missing AOT types exception message in builds, to impart slightly more info about what's happening in the first line of the message, just in case people aren't reading any more than the first line of the exception message.
Improved UI graphics for EnumToggleButtons, Lists, Dictionaries, AssetList etc..
InspectorPropertyInfoUtility.ProcessAttributes is now made public.
Made DrawPropertyRect obsolete, and removed all GUICallType.Rect and DrawPropertyRect from all Odin drawers, as they didn't really do much. You can get the same behaviour by overriding DrawPropertyLayout and calling GUILayoutUtility.GetRect or EditorGUILayout.GetControlRect.
Made some structural project changes in preparation for the open sourcing of Odin's serializer.
MemberInfoExtensions.IsStatic should now support all cases.
Some structural changes to make Odin Serializer open source.
Moved the SerializationUtility.CreateCopy method into UnitySerializationUtility instead.
OdinAttributeResolverLocator.GetResolvers is now public.
OdinMenuItems now has a single value property that does nothing fancy, instead of ObjectInstance and ObjectInstances. ObjectInstance and ObjectInstances will continue to be supported for a good while.
OdinMenuTree.ScrollToMenuItem now works before the tree is fully created, and now automatically expands all child objects to make the menu item visible.
Polished GeneralDrawerSettings a bit.
Polished the look of a lot of various UI elements.
Removed "Exclude Assembly Definitions With Editor Reference" from AOT Generation options.
Removed the EditorIcons overview from "Tools > Odin Inspector > Odin Editor Icons" The window can still be opened manually by calling EditorIconsOverview.OpenEditorIconsOverview();
Removed TypeExtensions.HasCustomAttribute<T>, and switched usage everywhere to the much faster and better IsDefined extension methods.
Renamed the LINQ Extension Append to AppendWith to avoid name colission with newer .Net Framework versions.
Replaced the RequireValidPath property with RequireExistingPath in the File/FolderPath attributes to better reflect the behaviour of the property.
ShowDrawerChain now greys out chained drawers that were not called during drawing.
ShowIf, HideIf, EnableIf and DisableIf attributes now work when referencing class and interface type member. They will turn on when the referenced member has a value, meaning that ShowIf will show the property if the referenced member is not null.
The CompositeDrawer can now draw collections as a series of elements, though it cannot do collection manipulations on said elements.
The enums flag and other Odin selector popups, now changes the value while the editor is open, instead of waiting until the window is closed. The values are still only applied on when the window closes so it doesn't fill up the undo stack.
The header height of FoldoutGroups now matches the header height of BoxGroups.
The reference object picker is now also rendered for value types boxed into reference type members.
The top toolbar of TableLists, now matches the style of regular lists.
To improve editor performance, the Composite drawer no longer resets the EditorGUI.IndentLevel for each property using the Unity Layout system. Instead, it is now up to each drawer to add support for Indent Level, which most drawers already does.
To reduce clutter in the inspector, the polymorphic object fields are no longer drawn inside a box. Instead, they now look almost exactly like the unity object fields, but with a foldout instead of a label. https://jumpshare.com/v/geUGtRfXHuM9tCE5G2od.
Updated documentation for ShowDrawerChain attribute.
Updated documentation for TabGroup attribute.
Removed the ContextExample script and replaced it with a new InstancedDrawerExample script.
SirenixEditorFields.PolymorphicObjectField is now far better at handling Unity objects. Unity objects in Odin Serialized interface fields are now much nicer to use. SirenixEditorFields.PolymorphicObjectField also saw some more general improvements to usability and niceness.
Unity object fields drawing the PreviewField attribute now behaves the same as regular UnityObject fields. When you open up the Unity object picker, the current value is highlighted, and the value of the field gets updated whenever you select a new object.
The CollectionDrawer no longer uses Debug.LogError to notify the user about invalid settings in the ListDrawerSettings attribute, but instead displays an error box on top of the list inspector itself.
The ProgressBarAttribute.CustomValueStringMember can now be used to reference a method that takes the current value of the progress bar field.
Added a warning message to non-serialized properties that sports both the SerializeField and the ShowInInspector attributes. This message can be disabled in Tools > Odin Inspector > Preferences > Serialization.
The Root menu item of OdinMenuTrees can now be accessed from odinMenuTree.RootMenuItem.
Fixed a rare bug where ValueDropdown on lists would not work the first time the selector was used if no OdinEditorWindow had yet been opened.
CollectionDrawer (formerly ListDrawer) now takes into account when the property label is updated when drawing the list label.
DeAliasX utility methods now also properly de-alias nested aliased members.
Added "in" to the list of reserved C# keywords that TypeExtensions.IsValidIdentifier checks against.
Added better thread safety to TypeExtensions.
Added safety so the property system can handle types that have the GetType() method shadowed with the new operator, such that it returns the wrong type.
DragAndDropUtilities.GetDragAndDropId now gets a more reliable Id, which is immune to damages in GUIUtility.GetControlId.
Edited Unity serialized prefab modifications now appear bold again in the inspector.
ExposedReference<T> is now drawn correctly by Odin, as well as all other legacy Unity drawers for generic types.
ExposedReference<T> no longer causes the property system to log a warning about being unable to find a member for the "Array" property.
Extensive fixes to prefab modification handling of changes to list and array lengths, particularly lists and arrays that are null on the parent prefab.
Fix a bug where an extra foldout would be drawn for GUIState type fields.
Fix to ShowInInlineEditorsAttribute documentation.
Fixed an issue where Type fields would throw null reference exceptions when the user was typing a string into the field.
Fixed a bug where any time a member would be aliased in the inspector Unity would crash.
Fixed a bug where AOTGenerationConfig.ScanProject would throw an exception when executed from command line. #282.
Fixed a bug where buttons in ButtonGroups wouldn't mark the object dirty when clicked.
Fixed a bug where ExpandFoldoutByDefault and a few other settings would not load the custom settings specified by the users at startup.
Fixed a bug where Foldouts would eat events it was not supposed to.
Fixed a bug where GetAssemblyDirectory() would throw an Invalid path exception if the path of an assembly has an invalid file path.
Fixed a bug where GetAssemblyLocation didn't work on Unix based systems causing a lot of trouble!
Fixed a bug where GUIHelper.CurrentIndentAmount always returned 0.
Fixed a bug where in the latest version of Unity 2018.2.x where the unity object picker would in some cases break after pressing play or triggering a recompilation.
Fixed a bug where invoking buttons sometimes would result in unwanted layout errors showing up in the console.
Fixed a bug where OdinMenuTree.AddAllAssetsAtPath and some EditorOnly mode options would not work correctly in .NET 4.6.
Fixed a bug where reordering menu items in OdinMenuTrees would cause keyboard navigation for root level menu items to mess up.
Fixed a bug where RequireValidPath in FolderPath and FilePath attribute, would not update if the path was changed from code.
Fixed a bug where ScrollToMenuItem would not always scroll to it during the first couple of frames.
Fixed a bug where SirenixEditorGUI.SeachField would use events it was not supposed to.
Fixed a bug where some layout elements would be pushed in 4 pixels while SirenixEditorGUI.Begin/EndFadeGroup was expanding or collapsing.
Fixed a bug where some settings would not be reset properly in "Tools > Odin Inspector > General"
Fixed a bug where the OdinUpgrader would print errors to the console in 2017.1 caused by calling UnityEditor.EditorApplication.isCompiling.
Fixed a bug where the UnityEditor would sometime crash on MacOS when dragging a unity object into a PreviewField.
Fixed a typo in the Serialization Debugger.
Fixed an error where all prefab modifications on elements in list entries deeper than one "member level", past the first applied modification, would not work correctly due to being associated with a faulty prefab modification path.
Fixed an issue where buttons in TableLists would spam the console with GUIContent null warnings.
Fixed an issue where InspectorPropertyInfo.CreateForMember did not respect any PropertyOrder attributes.
Fixed an issue where OdinDropdownWindows didn't popup properly on macOS.
Fixed an issue where the foldout icon would overlap on divider on object values in Dictionary inspectors in inline mode.
Fixed an issue where the open folder button could not be clicked when the field was disabled.
Fixed bug where Space attribute would only ever apply space to list elements and nowhere else, instead of applying space to everywhere else and never on list elements.
Fixed bug where, in newer versions of Unity, Odin serialized UnityEvents would be broken upon deserialization.
Fixed bug where, when multi-selecting objects and editing values, only the value on the first selected object would ever actually be changed.
Fixed case where creating the new getter setters for properties would often fail when the member is declared on a base type.
Fixed case where dragging Odin serialized polymorphic classes of different types around in a list/array on a prefab instance would cause exceptions to be thrown and some dragged values to be lost.
Fixed case where legacy Unity Property drawers would not be drawn if Odin didn't think that Unity would serialize the type to draw; this was particularly relevant for the case where a drawer that draws derived types targets an abstract class.
Fixed case where Odin referenced Assembly.ManifestModule, which is not supported on UWP even with IL2CPP enabled.
Fixed cases where groups would choose the wrong member to insert themselves at, when deciding which of their contained members they should replace. Now it is always the first ordered member, not the member first encountered through reflection regardless of order.
Fixed crash that occurs sometimes when applying prefab instance modifications to prefab, by delaying the action using EditorApplication.delay.
Fixed DirectoryNotFoundException occurring when opening the Editor Only Mode preferences window when the Demos folder has been deleted.
Fixed error in BinaryDataReader where it could land in an infinite looping state while trying to enter a node, if it read an unexpected, faulty type ID entry just after entering a prior node - this could happen sometimes when reading corrupted data.
Fixed error in Unity 2018.2 when drawing things with legacy Unity property drawers, such as UnityEvents.
Fixed error in UnityPropertyHandlerUtility when drawing legacy Unity property drawers in Unity 2018.2 and above.
Fixed error that would occur in legacy Unity property drawers invoked by Odin, when GetPropertyHeight() mutated the property using property.Next().
Fixed error where array lengths could not be modified at all in prefab instances.
Fixed error where DefaultMethodDrawer would ignore it if a custom label was passed down via property.Draw(label).
Fixed error where deserializing an ushort would always fail.
Fixed error where the ValidateInput attribute would cause invalid IL exceptions when declared on a struct, and the validation method on said struct is non-static.
Fixed error where the new property system would throw emit errors when trying to create emitted getters for const fields; const fields should now be able to be displayed.
Fixed errors with dictionary prefab modifications.
Fixed issue where InlineButton attribute would be applied to list elements.
Fixed issue where TypeExtensions.IsFullyConstructedGenericType would in some cases mistakenly return true for not fully constructed generic types.
Fixed OnValueChanged event not being triggered when changing Gradients, AnimationCurves and Colors via the inspector.
Fixed rare null reference exception in the property system that might happen when changing the polymorphic type of an object, or setting an object reference to null.
Fixed Unity bug with ObjectSelector's static constructor field initializers calling GUI code at an invalid time, resulting in a billion errors everywhere.
Fixed various indent support issues throughout Odin.
Flag enums with a named "None"/0 value, now have that name used instead of "None".
Having a scene prefab instance selected while exiting play mode no longer causes a lot of binary data Unity prefab modifications to be set on the prefab instance.
Improved right-click context menus - the highlight indicator should now go away more consistently, and it also performs a lot better.
InspectorProperty.LastDrawnValueRect now gives you the correct rest, even if the same property is drawn multiple places.
Legacy Unity attribute drawers are now only drawn for elements in a list when the attribute is placed on a list element - as is the case in "vanilla" Unity.
Legacy Unity decorator drawers are now only drawn once for a list, and no longer also for each element in the list.
Made AssemblyUtilities.IsDynamic more robust.
Made GeneralDrawerConfig settings more reliable.
Members declared by their interface implementation name no longer break the property system because their names contain the '.' character.
Object picker dropdown for generic types now also lets you create possible compatible variations of generic type definitions.
Odin can now display, serialize and deserialize value types boxed into a ValueType instance. #328.
Odin can now serialize gradients again, and the new GradientMode enum is also serialized in versions of Unity where it exists.
OdinMenuStyle's "Copy C# Snippet" now correctly uses the invariant culture to convert floating point numbers to string representations, and should no longer result in faulty C# code if the user has an en-US locale active.
Odin serialized Gradients now work again in Unity versions where the mode property has been added to the Gradient class.
PrefabModifications can now once more be applied to Odin serialized values handled by the atomic property system, such as enums.
Registering new prefab modifications to be applied with UnitySerializationUtility.RegisterPrefabModificationsChange now also sets those modifications to the modification cache instantly.
SerializedScriptableObject and SerializedUnityObject no longer nonsensically implement ISupportsPrefabSerialization.
SirenixEditorGUI.Begin/EndFadeGroup now fixes layout popping issues caused even better, making foldouts and attributes like HideIf and ShowIf attributes really smooth.
String values changed from the prefab parent now automatically have changes registered even without a manual RegisterPrefabValueModification call. This means dragging and dropping strings around in collections in prefab instances now correctly sets modifications again.
The SerializableFormatter class now also finds ISerializable constructors defined in the serialized type's base classes.
Type-declared attributes are no longer added to child members for parent types that are defined in the .NET framework or by Unity - only custom user-defined types and plugin types should display this behaviour now.
UnitySerializationUtility.SerializePrefabModifications now correctly clears the referenced unity objects list even when there are no modifications to serialize.
Updated classes in the VectorIntDrawer.cs file to the new drawer standard.
Using SmartValue on a value entry to change the type of that value will now result in a delayed value set, which will "lock" the value entry until the end of the next repaint event, where the value will be properly set and the lock will be lifted.
When you try to set an invalid key value on a dictionary, you can now re-enter the old key value and disable the invalid change UI.
You can now drag Unity objects onto an interface field that already contains a Unity object.
Fix to issue where TypeExtensions.AreGenericConstraintsSatisfiedBy would return false for something like 'Generic<List<int>>' and 'List<int>'.
Fixed an issue where MemberSerializationInfo would claim that Unity does not support serializing strings.
Fixed an issue that sometimes caused an overwritten method with OnInspectorGUI attribute to appear twice.
BaseCollectionResolver.IsReadOnly now returns false if a collection is null, instead of throwing an exception.
Fixed a bug where some object pickers would always create a Unity instantiated instance of the object regardless of the serialization backend.
Whenever Odin gets types from an assembly using GetAllTypes, it now ignores assemblies that throw exceptions, instead of failing and propagating said exception.
Fixed a ton of layout consistency issues.
The DetailedInfoBox attribute now works on methods as well.
Fixed a bug where InlineProperty would not work on odin serialized reference types.
Odin Serializer Improvements
Added the AOTSupportScanner type, which offers a more granular control over an AOT support scan than was previously possible. The AOTSupportUtilities class now uses an AOTSupportScanner behind the scenes.
Clarified and expanded documentation of SerializationPolicies.Unity and SerializationPolicites.Strict to be more clear about their exact behaviour.
Clarified documentation of PropertyInfoExtensions.IsAutoProperty, and added new optional bool parameter "allowVirtual" to be more clear about the method's exact behaviour.
SerializationPolicies are now allowed to decide whether properties that are not non-virtual auto-properties should be serialized.
UnitySerializationUtility.OdinWillSerialize now takes a serialization policy as parameter, to indicate which serialization policy Odin is
serializing within the given case. Additionally, this method will now *always* return false for all members declared on
UnityEngine.Object types, so they are never serialized by accident. Before if, for example, SerializationPolicies.Everything was used,
some of UnityEngine.Object's internal native pointers would be serialized, with predictably crashy results.
Odin Serializer Fixes
Fixed deserialization data preservation casting so it also works for reference types.
Odin serialization no longer explodes in the new nested prefab system, and so a basic functionality is restored in the nested prefab preview version of Unity. However, note that the nested prefab preview version of Unity is still not officially supported by Odin.
Added safety to cope with cases where, for unknown and likely eldritch reasons, types have the GetType() method shadowed using the new operator.
Made AssemblyUtilities.IsDynamic() more robust.
BindTypeNameToTypeAttribute now has AllowMultiple = true, as it should always have had.
Fixed typo in AOTSupportScanner exception message.
UnitySerializationUtility.SerializeUnityObject now correctly uses the context's serialization policy to select members for serialization.
All UnitySerializationUtility.SerializeUnityObject overloads now correctly use the context passed as argument (if one is passed) when pretending to be in a built player during editor play mode.
Removed errant System.Reflection.Emit namespace reference in DelegateFormatter.cs