Odin Inspector Version 1.0.5.0


Upgrade notes

  • After upgrading, you can freely delete the Sirenix/Assemblies/Editor folder and whatever version controlled files you had in it before for ignoring the now defunct GeneratedOdinEditors.dll files.

Highlights

  • Say goodbye to GeneratedOdinEditors.dll

    We have adopted a new, DLL-free method for making Unity draw Odin's inspectors, that does not rely on declaring editor types with CustomEditor attributes on them. This means that Odin will no longer cause an extra recompilation every time you change your types, and that Odin can instantly update which types it draws at runtime when you change the settings, without any reloads at all.

    Additionally, this means that we have now lifted all of the prior restrictions on which types could be drawn by Odin (IE, only public types with valid C# names, that did not share full names with other types and were not declared in assemblies with spaces in their name).

    Finally, this should resolve all crash bugs and hang issues that generating editors were causing in 2017.1 and 2017.2.

  • Persistent Editor States

    Odin now features a new Persistent Context system. Now when you switch to a different tab, close a foldout, or select a different color palette, and leave, you can come back and find the inspector in the state you left it. This is great for when you have a lot of objects, and you're jumping between them a lot.

    This works when switching between objects, when Unity reloads and even after Unity has been shut down and restarted. The Persistent Context system will cache your inspector state until the cache reaches a configurable size.
    At this point, it'll clean out older states, in order to keep itself within the memory limit.

    You can change the size of your cache, or completely disable the caching altogether from the Persistent Context preferences window in 'Tools > Odin Inspector > Preferences > Persistent Context'.

  • Dictionary Key Type Support

    Dictionaries now support having keys of any type, except on prefab instances, where key type support is still limited.

    Dictionary key type support on prefab instances is now extendable for value type keys. See here for details.

  • AOT Support

    Added serialization AoT generation for generic type variants, which should help fix all serialization issues on IL2CPP/AoT platforms that were caused by no AoT code being generated for the needed generic variants of relevant methods and types.
  • Two Dimensional Arrays and List Tables

    Odin can now show two-dimensional arrays as tables in the inspector. The tables can be modified using the new TableMatrix attribute.

  • A new TableList has been introduced enabling you to render a list as a table. The width of the table columns can be modified via the TableColumnSize attribute.
    Note: the TableList attribute does not yet have support for drag and drop, but it contains a button that toggles between the regular list and the table list attribute so, for now, you need to switch to the regular list view if you want to modify the item order.
  • Editor Only Mode

    You can now completely enable and disable the Odin Serialization system via a single button located in our new Toggle Serialization window found in Tools > Odin Inspector > Preferences. The Odin Preferences window now has a new window called "Toggle Serialization"

New Attributes

  • Added a new attribute called CustomValueDrawer which lets you create a custom property drawer with a single method. This is especially useful in cases where you need a one-time custom thing and you don't want to go through the trouble of creating a new attribute and a new attribute drawer just for that. These drawers will out of the box have support for undo/redo and multi-selection, and you can still combine them with other attributes as well.
  • Using the new Folder- or FilePath attributes, you can now easily edit directory paths in the inspector. Use the dialog window, or drag and drop assets from your project view onto your path fields. Get paths that are relative to Unity, or anywhere else. Double click the properties to highlight the targets in the project view.
  • Using the new ProgressBar attribute, you can visually display and even edit any percentage. Use it to create a healthbar, or display how full an inventory is. You could also make a stacked healthbar, that switches color when one bar is filled. Similar to what you might find in a fighting game.
  • Added SuffixLabel attribute that draws a label at the end of a property. Useful for conveying the nature of a property.

Fixes

  • Made a multitude of fixes to Odin-serialized prefab instances. They should now be far more reliable, and mimic Unity's own behaviour very closely.
    • Fixed error where dragging reference types in Odin-serialized lists on prefab instances could sometimes result in invalid references being serialized in the modifications, causing lost values and unintended reference properties.
    • Applying changes to a prefab instance should now wipe Odin prefab modifications for all components in the entire prefab's hierarchy, not just the ones on the currently selected GameObject.
    • Fixed case where the "Revert to prefab value" context menu item would always be disabled for properties on non-Odin-serialized objects.
    • Fixed issue where Odin-serialized Unity object references on prefab instances would often be set to the references on the prefab instead.
    • Odin-serialized references to scene objects in prefab instances no longer become null when the prefab instance is applied.
    • Odin-serialized references to scene objects are no longer automatically marked as changed prefab values when they correspond directly to the same local prefab object reference on their prefab.
    • Odin-serialized Color and Color32 values can now be properly changed on prefab instances. To facilitate this, Color and Color32 have been marked atomic.
    • Fixed crash that would happen sometimes when changing modified values on Odin-serialized prefab instances that are in prefabs with a hierarchy that contains UI components.
  • Fixed a bug where the the Instance Creator Window could not find interface types that with a generic type definitions.
  • Fixed invalid generic argument error when creating serialization formatters for multidimensional arrays on .NET 4.6.
  • Fixed a bug where the GUIStyle drawer did not support labels being null.
  • Fixed a bug with the AlignCenter Rect extension.
  • Fixed error where emitting formatters for a type with a serialized member that has the same name as an inherited serialized member would cause Unity to crash.
  • Fixed error where CTRL-clicking a null value to instantly populate it with a new type instance would sometimes cause an exception to be thrown.
  • Fixed issue with DisplayAsString where the string wouldn't overflow if the property was drawn with a label.
  • Fixed [LabelText] not working on gradients.
  • Fixed Gradients showing "Element 0", "Element 1", etc labels when displayed in lists, in cases where there should be no labels at all.
  • Fixed case where Odin would only register a Unity PropertyDrawer to draw one type, even if it has several CustomPropertyDrawer attributes on it.
  • Fixed null reference exception that would occur when a property without a setter was marked for serialization. (It would not serialize regardless, as both a getter and a setter is needed.)
  • Fixed issue where RectDrawer didn't respect the 'Expand Foldouts by Default' setting in General Drawer Config.
  • Fixed ValueDropdown attribute not working on list elements.
  • Fixed issue where layer 31 could not be selected for LayerMasks properties.
  • Fixed issue with quaternion fields being hard to use.
  • Fixed case where an invalid cast exception would be thrown for a frame or two when a polymorphic value is changed to another polymorphic value of a different type.
  • Fixed case where overriding equality operators and GetHashCode to implement custom object equality, would incorrectly result in references being serialized and shown in the inspector, for objects which were equal, but not the same references.
  • If a deserialized value implements IObjectReference, other references to that object in the deserialized graph will now correctly point to the value retrieved using IObjectReference.GetRealObject()
  • Multidimensional arrays now become single "regular" reference type properties with no children, instead of causing exceptions in the inspector.
  • DefaultSerializationBinder can now handle type lookups when types are declared in assemblies that have names with spaces in them.
  • The property system can now handle IList and IList<T> implementations that throw NotSupportedExceptions and NotImplementedExceptions in the IsReadOnly property getter. In these cases, it is assumed by default that the list is *not* readonly.
  • DetailedMessageBox no longer uses a control ID, which could be disruptive for other GUI controls when appearing and disappearing.
  • Made a potential fix to the issue where all Sirenix icons would be rendered black for some people. We still don't what causes them to be black, so feedback to whether or not the fix worked would be much appreciated.
  • AssemblyUtilities class now also registers assemblies that are loaded late, after the initial assembly scan has been performed.
  • Newly added list and array elements in Unity-serialized lists and arrays are now properly initialized (and not null) by the time OnValueChanged is called.

Changes

  • Moved Odin's menu items from "Window > Odin Inspector" to "Tools > Odin Inspector" to properly follow Unity's guidelines for assets.
  • Made various upgrades to quaternion drawing
    • Quaternion fields now better detect when they're being edited, and are therefore able to be edited and updated in the inspector from script.
    • Quaternion fields now have a refresh button, which updates the value in the inspector, to accurately show the internal quaternion value.
    • DetailedMessageBox now has it's own style in SirenixGUIStyles, instead of temporarily modifying SirenixGUIStyles.MessageBox.
    • Added new quaternion field methods to SirenixEditorFields. All old quaternion methods have been marked as obsolete.
  • Unity ObjectFields now always show the open in new inspector button.
  • SirenixEditorGUI.ObjectField has been marked obsolete, use SirenixEditorFields.UnityObjectField and SirenixEditorFields.PolymorphicObjectField instead.
  • DetailedInfoBox, no longer now toggles between the short and detailed descriptions, instead of extending the short description with the detailed description when expanded.
  • The ReadOnly and LabelText attribute can now also be applied to methods.
  • GetNiceName for MemberInfo's no longer adds spaces between uppercase and lowercase letters.
  • The LabelText attribute now also works on methods.
  • All Odin menu items have been moved to the Tools > Odin Inspector menu.
  • Groups with order priority 0 (IE, no priority defined) now inherit the order of the first member of the group, so that they will be placed more intuitively in the inspector.
  • PropertyContext<T> now has a private constructor, to prevent accident creation in drawers. Use PropertyContext<T>.Create() instead.
  • Removed this the background color shifting for Box and Tab groups as they interfered with other elements.
  • Renamed "Odin Preferences" window to "Sirenix Preferences".
  • TitleGroup no longer indents by default.
  • Removed the "Assets/Update Assembly Guids" menu item.

Additions

  • Added the "UseAsset" property to GlobalConfigAttribute, which lets a global config class specify whether an asset should be created for it or not.
  • Added support for decimal properties for Range attribute.
  • Added support for decimal properties for PropertyRange attribute.
  • Added missing documentation to PropertyRange attribute.
  • The InlineEditor attribute now has a MaxHeight property.
  • Added support for the following key types in dictionaries on prefab instances using the new extension system: Vector2, Vector3 and Vector4.
  • Added Sirenix.OdinInspector.Editor.OdinPrefabUtility class, which contains utilities for registering from user code that prefab instance values have been changed and should be persisted.
  • Added a max recursive draw depth setting, which stops properties from being drawn recursively past a certain depth, preventing Unity from freezing up if an accidental infinite depth draw loop is created.
  • Added SetCurrentPage to GUITabGroup, which switches directly to the specified page, with no animation.
  • DrawDefaultInspector on OdinEditors now also draw the editor using Odin.
  • Implemented Rect extensions for splitting a rect into a grid.
  • Implemented attribute drawer for Unity's ColorUsage attribute.
  • Added two methods named FindParent to InspectorProperty which recursively walks through all parent properties until a certain criterion is met.
  • Added option to DisplayAsString attribute, to enable or disable the string overflowing to multiple lines or not.
  • Added PaddingTop and PaddingBottom to VerticalGroup attribute.
  • Added UnitySerializationUtility.CreateDefaultUnityInitializedObject, which creates an object that is initialized with default values in the same way that default values are normally set by Unity.