Odin Inspector Version 2.1.4

Improvements

  • All C# files now include #pragma warning disable when built for Source Code.
  • GUIHelper.ContextWidth no longer has a setter, to reflect internal changes made in Unity 2019.3. Use the new GUIHelper.PushContextWidth and PopContextWidth to adjust the context width instead.
  • Removed [Obsolete] from AssetUtilities.GetAllAssetsOfType and AssetUtilities.GetAllAssetsOfTypeWithProgress, since they perform a very real and useful function.
  • Attribute Overview documentations buttons now link to odininspector.com/attributes instead of odininspector.com/documentation.
  • Refactored CustomContextMenuAttributeDrawer for more modern Odin practices and better performance.
  • Odin's AnimationCurveDrawer now tracks changes to inspected AnimationCurves not made manually through the editor, and forces Unity to update all AnimationCurve previews whenever such a change happens.

Fixes

  • Added missing RegisterValidator attributes for File- and FolderPathValidator classes.
  • AssetSelector now works with interface fields.
  • AssetUtilities.GetAllAssetsOfType and AssetUtilities.GetAllAssetsOfTypeWithProgress now correctly distinguishes cases where it should use type.FullName vs type.Name for an asset database query. This fixes the bug where [AssetList] could not properly find any Unity-defined ScriptableObject asset types such as Sprite and Material.
  • Fixed a bug in 2019.2 where IMGUI Containers will sometimes draw Odin without any current window. Causing various null references exceptions to occur. Odin no longer requires a Current Window to be present.
  • Fixed a Source Code build issue where files would have two copyright headers.
  • Fixed GUIHelper static initializer breaking in newer versions of the Unity 2019.3 alpha.
  • Fixed an issue where users couldn't click bool label-less and indented checkboxes.

Odin Inspector Version 2.1.3

Fixes

  • Automated AOT support no longer throws an ExitGUIException at build time after generating a DLL.
  • The DictionaryDrawer now only applies to properties that actually have the appropriate StrongDictionaryPropertyResolver as child resolver. This fixes the bug where Unity objects that implemented the IDictionary<TKey, TValue> would show up as dictionaries in the inspector.
  • The [CustomValueDrawer] attribute now supports polymorphism in the drawn member, and always requires a custom drawer method for the member type, not the type of the actual value in the member.

Odin Inspector Version 2.1.2

Highlights

  • Unity 2019.2 support
  • Major initialization performance improvements and more coming soon

Improvements

  • Initialization of InspectorTypeDrawingConfigDrawer is now roughly twice as fast as it was before; depending on the amount of types in your project, this can shave a few dozen to several hundred milliseconds off of your script reload times.
  • If a TargetInvocationException is thrown during validation, the validation system will display the inner exception instead of the invocation exception.
  • TableMatrix.DrawElementMethod now accepts a method overload which provides the array and index to draw, instead of the value.

Fixes

  • Fixed a bug in 2019.2 where IMGUI Containers will sometimes draw Odin without any current window. Causing various null references exceptions to occur. Odin no longer requires a Current Window to be present.
  • AOT support generation now directly references base class functionality which it will need. Usually, merely referencing a derived class is enough, but certain base class methods wouldn't be referenced properly when generating IL2CPP builds for PS4, unless they were referenced directly.
  • AOT support generation will now also generate basic support needed for serializing abstract types.
  • Fixed bug in the expression compiler where compiling would throw an exception if a method called with explicit generic arguments had a non-generic overload.
  • Fixed bug in the expression compiler where either side of the "&&" and "||" logical operators would not be implicitly converted to bool when necessary.
  • Fixed issue on AOT platforms where using tags like [OnSerialized] and [OnDeserialized] in a type would throw JIT-related exceptions during static initialization of formatters for that type.
  • Fixed issue where serialization would throw exceptions while claiming objects from the Cache<T> class on Playstation 4 (in both Mono and IL2CPP builds), due to seemingly-wonky handling of generics on PS4.
  • GUI layout exceptions and invalid GUI stack state exceptions are no longer thrown when clicking "Generate DLL" in the AOT Generation preferences.
  • If an ExitGUIException is thrown during a GUI button click, the exception will now correctly be rethrown.
  • Odin's About and Getting Started windows will now correctly display the currently installed version of Odin again.
  • The AlwaysFormatsSelf attribute can now also be applied on structs.

Odin Inspector Version 2.1.1

Improvements

  • Added try/catch and debug logging to the case where a base64-encoded string/binary blob is invalid.
  • Odin will try to deserialize with the byte[] data before the base64 string, if there is byte[] data, and will not skip byte[] if it does exist under any circumstances.

Fixes

  • Worked around the issue where accessing DateTime.Now early on the Unity loading/deserialization thread would cause Unity to throw internal exceptions - a "timeless" int counter is now used as there is no longer a safe way to access DateTime.Now or any similar time concept on non-main threads in Unity.
  • Fixed a bug where the ColorPaletteAttribute would sometimes cause other GUI elements to not work properly.
  • Fixed a bug where message boxes in the inspector could cause strange indent issues.
  • Fixed error where [AssetList] would not work for GameObject and List<GameObject>.
  • Fixed issue where marking a nullable value type such as "float?" with [ReadOnly] would cause it to throw a ton of exceptions.
  • Fixed Odin 2.1 regression where the static inspector would no longer work properly for classes (only for structs).
  • Fixed bug in the expression compiler where compiling would throw an exception if a method called with explicit generic arguments had a non-generic overload.
  • Fixed bug in the expression compiler where either side of the "&&" and "||" logical operators would not be implicitly converted to bool when necessary.

Odin Project Validator Improvements

  • Fixed an issue where error-counts woulnd't update when rescanning a profile.
  • Added more API documention coverage for Odin Project Validator.
  • The GUI of the Validation window no longer resets every time you enter a new validation profile. It now remembers which columns were selected, how wide the side menu was and so on...
  • When running a validation profile and zero issues were found, a green '0' label will be shown next to the profile name, instead of not displaying anything.

Odin Inspector Version 2.1.0

Making sure everyone on your team sets up your data correctly when working directly with assets is made easy using the live input validation features that Odin Inspector provides. However, sometimes, warning messages get ignored, assets get deleted, requirements change, and data is made obsolete as your project grows. Slowly bugs, errors, and faulty data creep in as work progresses. Manually going through your entire project to find and correct issues can quickly grow to be an insurmountable task.

Using the Odin Project Validator, you can easily scan your entire project for warnings and errors, and fix them inline right from the validator. The validator handles scene switching and saving as you work, letting you quickly and freely navigate between all issues with no hassle and no delay.

Learn more here

New tutorials, documentation and attribute overview

Our new website has brand new searchable tutorial, documentation and attribute overview sections - check them out and learn how you can get the most out of Odin already today!

Tutorials   Attribute Overview   Documentation

Community tools

Check out our new community tools page to see all the neat things people have built with Odin and made available to the community. Create an account to submit your own tools!

Learn more here

Please note: source code is now a separate pre-configured and easy-to-use package that you can download from our website, but the source code is no longer included in the core Odin Inspector package sold here and on the Asset Store.

Everyone who has purchased Odin Inspector before the 2.1 beta started (28.05.2019) will receive the source code and Odin Project Validator addons for FREE, starting now we will be selling the source code as a separate paid package.

New Odin Inspector 2.1 Features

Expressions

Start your string with an '@' sign, and write C# directly in your attribute declaration; this works in almost all attributes that take a string. This reduces boilerplate code and introduces countless new possibilities.

Learn more here

Interactive Attributes Overview Window

You no longer need to import the demo scene; all attribute examples are now available in a window: Tools > Odin Inspector > Attributes Overview

Also see our new online attributes overview

New AssetSelector attribute

A new, simpler alternative to the AssetList attribute, the AssetSelector attribute prepends a small button next to the object field that will present the user with a customizable hierarchical dropdown of selectable assets.

Learn more here

New ChildGameObjectsOnly attribute

Avoid having to manually locate the desired object in the hierarchy, while at the same time telling your designer how your component should be used!

Learn more here

New ShowIfGroup and HideIfGroup attributes

ShowIfGroup and HideIfGroup are group attributes that allow for showing or hiding a group of properties based on a condition. They can be combined with other group attributes using group paths, and can be used this way to show or hide groups of any kind.

See ShowIfGroup examples   See HideIfGroup examples

New validation backend

Before, Odin had separate drawers for attributes such as the Required, ValidateInput and AssetsOnly attributes. Now, all of these have been turned into standalone Validators, and are drawn in the inspector by a single drawer that integrates the new validation system.

This means that you can now easily define your own validators. Errors and warnings will then automatically show up in the inspector. Furthermore, the new validation system is completely separate from the drawer system. This means that you can manually invoke the new, straight-forward validation API from anywhere to integrate project validation in your own custom workflow and build pipelines.

You can make your own AttributeValidators and ValueValidators. Below is a simple example of how you could create a validator that would display an error in the inspector if a texture too large for your game is used.

[assembly: RegisterValidator(typeof(TextureSizeValidator<>))]

public class TextureSizeValidator<T> : ValueValidator<T>
  where T : Texture
{
  protected override void Validate(T value, ValidationResult result)
  {
    if (value && value.width > 1024 && value.height > 1024)
    {
      result.Message = "We're making a mobile game for crying out loud!";
      result.ResultType = ValidationResultType.Error;
    }
  }
}

Your custom validators will also be integrated in the new Odin Project Validator.

More examples and tutorials will be added soon.

Performance Improvements

  • Odin now triggers far fewer serialization calls per frame, vastly improving performance when inspecting data-heavy objects.
  • Odin now caches property path lookups, resulting in far less time spent parsing property paths.

Additions

  • Type entries in the AOT Generation Config window as well as Type members drawn in the inspector can now parse type names written in the style of C# identifiers, IE, writing "Dictionary<int, string>" will now work.
  • Added GUIHelper.PingObject which is a more feature rich version of Unity's PingObject.
  • Added GUIHelper.SelectObject.
  • Added IfAttributeHelper class which allows for easy implementations of If style attributes.
  • Added OdinMenuTree.Selection.SelectedValue and SelectedValues.
  • Odin Selectors now displays an infobox if the selector doesn't contain any items.
  • RectExtensions.AlignCenterXY(this Rect rect, float width, float height).
  • Added ability to provide a member/expression string to the [MinValue] and [MaxValue] attributes.
  • Added HideTabGroupIfTabGroupOnlyHasOneTab to the TabGroup attribute.
  • Added MemberFinder.HasConvertableReturnType, which requires only that it is possible to convert the return type to a given type using the new ConvertUtility.
  • Added the ConvertUtility class, to provide weakly typed conversion and casting that takes all factors, declared cast operators, and possible conversions into consideration.
  • Added the GenericNumberUtility class, which provides some weakly typed number comprehension utilities.

Changes

  • Added deprecation warning to all Odin-serialized prefabs in 2018.3 and above.
  • All If- attribute drawers now use the new IfAttributeHelper class, instead of relying on PropertyContext lookups.
  • Group attributes, specifically the base PropertyGroupAttribute no longer has the JetBrains.Annotations.MeansImplicitUse attribute.
  • Removed attributes overview card from the Getting Started window, and replaced it a button to open the Attributes Overview window.
  • Removed attributes overview scene.
  • Renamed TypeInfoBoxAttributePropertyProcessorProcessor to TypeInfoBoxPropertyProcessor because was running into errors due to long path length.
  • ValueDropdownAttributeDrawer no longer invokes the referenced member twice when getting the value.
  • Dragging a value on top of a closed list now appends the value to the end of the list instead of the front.
  • Almost all of Odin's attributes can now be applied anywhere and are no longer restricted to only a subset of possible attribute application targets.
  • Changed "MISSING" text for type entries in the AOT generation config to "INVALID" to be clearer about the fact that it will do nothing.
  • InspectorProperty.Update() now returns a bool, indicating whether an update was performed or not.
  • Moved FastTypeComparer from Sirenix.OdinInspector.Editor to Sirenix.Utilities.Editor assembly.
  • Moved MemberFinder from Sirenix.Utilities to Sirenix.Utilities.Editor assembly.
  • Removed the Sirenix.Utilities.Editor.CodeGeneration namespace and all types therein, as they were an unused remnant of old systems that have since been replaced. If you were using it, you can extract the types from old versions of the source code and continue using them as you please.

Fixes

  • Fixed an issue where the effect of the TypeFilter would in some cases not be cleared and hence applied to other properties.
  • Fixed a crash when using DeepReflection on const fields.
  • Fixed divide by zero exception in RectExtensions.SplitGrid.
  • Fixed issue in 2018.3 where changing a PreviewField with the Unity object picker would sometimes change other preview fields as well.
  • Fixed a typo in FolderPath attribute drawer.
  • If an enum has a None value with [HideInInspector] on it, a new None value will no longer be injected by EnumSelector<T>.
  • Odin's default property member selection logic in InspectorPropertyInfoUtility will now always ignore properties that have index parameters.
  • TypeExtensions.GetCastMethod now also searches parent types for valid methods.
  • TypeExtensions.GetOperatorMethod and TypeExtensions.GetOperatorMethods now also search parent classes for valid operators.
  • A property's children are now disposed immediately when the property enters a value state that does not allow having children (null, reference, value conflicts).
  • AssetUtilities.GetAllAssetsOfTypeWithProgress now correctly handles cases where types with the same name exist in multiple different namespaces. #542.
  • Collection resolvers can now correctly handle the case of being asked about their child count, when the inspected collection is null.
  • Corrected spelling of ValidateInputAttribute.ContiniousValidationCheck to ContinuousValidationCheck and obsoleted the old member as a wrapping property.
  • Fixed a bug where the AssetSelector attribute would cause errors when used on components.
  • Fixed a bug where the ChildGameObjectsOnly attribute didn't work on list elements.
  • Fixed a bug where the ChildGameObjectsOnly attribute didn't work on list elements.
  • Fixed a bug where the MinMaxSlider attribute would clamp the values while you where entering numbers in the fields.
  • Fixed bug where a ColorBlock being drawn by the Unity PropertyDrawer legacy support system would cause an exception to be thrown any time a color value in the block is changed.
  • Fixed various places in the code where InspectorProperty.Info.GetAttribute<T>() method was being used instead of the more correct InspectorProperty.GetAttribute<T>() method. This was causing some attributes to not register correctly some places when added through a self property attribute processor.
  • Odin now uses PropertyHandler.GetHeight() to calculate the height for legacy Unity property drawers (when available), for its Unity property drawer backwards compatibility system. This means that property drawers which call EditorGUI.GetPropertyHeight() with their own property in a PropertyDrawer.GetPropertyHeight() override to calculate their drawing height, will no longer see a duplicate recursive call to PropertyDrawer.GetPropertyHeight() from that call, and they will be calculating the correct property height.
  • Properties returned by path through the PropertyTree path lookup methods GetPropertyAtPath, GetPropertyAtUnityPath and GetPropertyAtPrefabModificationPath are now always guaranteed to be reachable from the tree root - before, the newly introduced path-to-property cache might return invalid properties that were no longer reachable from the tree root.
  • Removed all API calls that were causing the assembly updater to need to run during import. This should fix Unity 2019.3 crashing during import of Odin, and should also mean that the assembly updater no longer asks to upgrade Odin assemblies during import.
  • Removed all references to the UnityEngine.UI assembly. Old functionality that used UnityEngine.UI is now weakly typed by reflection, and conditional on the assembly being loaded by Unity.
  • Setting a new value to a dictionary on a prefab instance now correctly sets the value that was constructed before adding, instead of default(TKey) - this fixes a regression that was likely introduced somewhere in between 2.0.10 and 2.0.20.
  • ValueDropdown now updates cached value names when the dropdown is opened; this means the label on the dropdown will now reflect the last collection passed to the dropdown.

Beta fixes

  • Fixed case where a validation scan would error when recursively validating a type which implemented only ICollection<T> but not ICollection or another other common collection interfaces.
  • Fixed a bug were the opening the Odin Project Validator window would undock it if it was already docked instead of focusing it.
  • Fixed issue where validation overview would break if any validator threw an exception the first time it ran.
  • The scene setup will now be properly restored when a scene validation profile is cancelled mid-validation.