Added EULA change notification to the Getting Started window popup.
Sirenix.Utilities.PropertyInfoExtensions.IsAutoProperty now takes an optional parameter specifying whether it should allow virtual properties to be considered auto properties.
Fix
Mac users rejoice! After a long time with little progress, we have finally fixed a long-standing issue that has plagued Mac users since the original 1.0 release of Odin: list drag-and-dropping should now always work smoothly and as intended on Mac. It turned out that a difference in the behaviours between Unity's Undo system on Mac and Windows was causing the list changes to be reverted by said Undo system. This has now been fixed on Mac, in a way such that Undo still works. This fixes issue #266.
Improved and fixed grammar and spelling in the serialization debugger's messages and reasoning about member serialization.
Applying the [LabelText] attribute to enum members now also changes the displayed value string of the enum, instead of only affecting the names of the value entries in the enum selector popup.
Delegates returned by TypeExtensions.GetEqualityComparerDelegate<T>() now consider float.NaN and double.NaN to be equal to themselves. This is different from the language convention, but more useful and correct for the purposes these returned delegates serve. This fixes issues #661 and #662.
Fixed an issue where no foldout control would be drawn on TableList toolbars when the TableList had no label.
InspectorProperty.RecordForUndo will now correctly *not* record for Undo if PropertyTree.WillUndo is false.
Odin's EnumSelector now also supports Unity's 2019.2+ [InspectorName] attribute for renaming individual enum values in the inspector. This has the exact same effect as using Odin's [LabelText] on enum members.
Odin Serializer
Change
The default SerializationPolicy (SerializationPolicies.Unity) now allows serialization of properties that are not virtual, and also properties that are not auto-properties. The only constraint for serializing a property is now that it has both a getter and a setter, regardless of accessibility. We still encourage people to not serialize properties, but this limitation was entirely artificial and in the end, we've chosen to remove it so people can make their own decisions in the matter.
Fix
Fixed some serious thread safety issues in Odin deserialization of Unity objects. This fixes async loading of addressables and other assets, and should fix a multitude of other mysterious, hard-to-reproduce issues that people have seen over the years with Unity object deserialization.
Delegates returned by TypeExtensions.GetEqualityComparerDelegate<T>() now consider float.NaN and double.NaN to be equal to themselves. This is different from the language convention, but more useful and correct for the purposes these returned delegates serve.
Changed the ICache<out T> interface to a weakly typed ICache, because older Unity runtimes crash the moment they encounter generic covariance.
Fixed sbyte's that were less than 0 always being deserialized as 0 by the binary data format.
Added extra try-catch guards around handling of loaded assembly such that broken/corrupt assemblies should be properly passed over/ignored during registration of type name rebinding attributes (BindTypeNameToTypeAttribute) in the DefaultSerializationBinder type.
Fixed rare case where DefaultSerializationBinder would cause an assembly loading deadlock deep in the Mono runtime, in projects with very specific assembly dependency setups.
Odin Validator
Fix
The build validation hook will now throw a BuildFailedException instead of a regular Exception, when it is trying to stop the current build from finishing.
Odin Inspector Version 2.1.12
Feature
Check for updates! You can now manually or automatically check for new Odin updates with Tools > Odin Inspector > Check for updates.
Fixes
AssetSelector should no longer care about trailing forward or backslashes.
Collection elements are no longer set to non-draggable if IsReadOnly is set to any value (even false).
EnumSelector<T>'s initialization scan when encountering a new enum will no longer throw dozens of hidden exceptions
that ruin your day if your attached debugger is set to break on exceptions. This was also causing performance issues
when opening inspectors that contain a *lot* of different enums - EnumSelector<T> initialization is now far, far
faster than it was before.
Fixed an issue where TableMatrix.DrawElementMethod wouldn't work for methods with the signature `T Method(Rect, T[,], int, int)`
despite claiming so. Thanks to @MilkyBrain from the Discord for discovering and finding the solution to this problem!
Fixed error where OdinMenuEditorWindow would erroneously always request repaints every frame and OdinEditorWindow
would request repaints every frame when it was focused.
Fixed the Project Validator always containing a warning in the On Play validation hook profile settings if the hook is set to open the validator on errors or warnings.
Removed Obsolete attribute from AssetUtilities.GetAllAssetsOfType<T> because the other obsolete attributes have already been removed.
Valid validation results now correctly draw an infobox if a message is set in the validation result.
ValueDropdown should work now on unordered collections.
Disabled *all* unaligned memory read/writes on Android and iPhone devices. This should fix all crashes that people
see with unaligned memory read/writes on some mobile devices with old or obscure CPU architectures. This fix comes
with a slight performance penalty to the binary format on mobile devices, as serialization now happens byte-by-byte
instead of in larger single-op chunks per written/read value.
Odin now treats SerializeReference just like SerializeField when determining whether it should serialize a
field in the absence of Unity, instead of just ignoring it when determining what it, itself, should be serializing.
Fixed an infinite read loop that could occur during deserialization of bad JSON data.
The AOTSupportScanner will now also scan scenes that are a part of asset bundles, instead of only prefabs and scriptable objects.
Odin Inspector Version 2.1.11
Features
Odin now fully supports polymorphism and inspecting of Unity-serialized members
decorated with SerializeReference, just as if they were Odin-serialized.
Now SerializeReference is a viable full replacement for Odin serialization
in most cases.
Improvements
Refactored the SerializationBackend enum into an extendable class instead, abstracting out the property system's understanding of serialization backends.
Renamed LinqExtensions.Prepend to LinqExtensions.PrependWith to prevent clash with .NET's Prepend method.
The message that logs exceptions thrown during regular Odin property drawing now also specifies the current IMGUI event type when the exception was thrown.
Add
Added InspectorProperty.RecordForUndo(), which handles all necessary details of correctly recording an Undo entry on
all required Unity objects. We encourage using this method at all times where possible, instead of manually invoking
Undo.RecordObject(), which is no longer the correct method to use in all cases.
Fix
Fixed ambiguous type match compiler errors in Odin source code builds in 2020.1 due to the newly introduced UnityEditor.FilePathAttribute class.
Fixed an issue where Folder- and FilePath's ParentPath property would sometimes be ignored by the validator, and this would cause incorrect errors with the RequiredExistingPath property.
Fixed an issue where some attributes would not work due to use of Conditional("UNITY_EDITOR") attribute.
Fixed case where the expression compiler would try to resolve identifiers as short type names before it tried
to resolve them as root namespaces, resulting in bad lookups for identifiers when a type name conflicted with a
root-level namespace identifier - for example, a type named SomeNamespace.System would conflict with the root
System namespace. This resolves a conflict in 2020.1.0a24 with the new UnityEngine.Rendering.VirtualTexturing.System type.
Fixed an issue where the Right Click -> Change Type context menu option was not changing the value properly.
Fixed an issue where using Unity's new [SerializedReference] attribute and changing the type would throw Undo-related
errors like "Generating diff of this object for undo because the type tree changed". Odin now has special undo
handling for changes made to SerializeReference members.
Odin now correctly show an "Apply to prefab" context menu item for properties which have been changed from their parent prefab.
The assembly GUID updater always uses lowercase GUIDs now, to reflect Unity .meta files preference for lowercase GUIDs.
Tooltip attribute drawers no longer use PropertyContext as that is an obsolete feature.
Odin Inspector Version 2.1.10
Improvements
(Almost) all attributes in the Sirenix.OdinInspector.Attributes assembly are now marked with [Conditional("UNITY_EDITOR")], such that they will not be applied to members outside of the editor itself. This saves space in builds that would otherwise be used for nothing at all, since the inspector-relevant attributes are only ever used in the editor. This does *not* apply to serialization-related attributes, which will still be included in builds.
Fix
Fixed issue where Odin drawing lists of AssetReference objects(from the Addressables package) would cause global editor corruption because Unity's built-in AssetReferenceDrawer would change the contents of GUIContent.none, causing issues globally.
Fixed case where generic matching would match an enum array such as MyEnum[] to the IList<int> interface it implements in newer Mono runtimes, and thus faultily consider "int" to be the element type of the array. This fixes issue #352.
Fixed the assembly Import Settings automation not working properly on Mac and thus causing all AOT builds to fail.
Buttons now also log thrown exceptions properly when they are invoking delegates that are not actual methods on the target type (most often added via a property processor).
InspectorPropertyInfo.CreateForDelegate now respects the order argument it is given and applies it to the resulting InspectorPropertyInfo.
OdinSerializer files in the source code build no longer have broken copyright headers.
Source code files now have their automatically added #pragma warning disable statement declared inside their namespace. This fixes an issue where Unity's source file parser would fail to parse the file and consider it invalid for a Unity object, thus breaking config assets in source code mode in some versions of Unity.
Remove
Removed SirenixInternalStuff.cs and the internal TodoAttribute, as it was not in use internally anymore, and was gross besides.
Odin Inspector Version 2.1.9
Fixes
Odin will now again properly locate and use legacy custom Unity property drawers that target attributes.
A PropertyTree's SecretRootProperty is now also disposed when the property tree itself is disposed.
Fixed case where expression compiler would fail to do proper number conversion on the operands for logical boolean number comparisons between floating point and integer operands such as "1f > 2", resulting in invalid IL code being emitted.
Fixed references to some obsolete members.
OdinPropertyProcessors are now also disposed when their associated ProcessedMemberPropertyResolver's is disposed (because of a property refresh or a property being disposed).
Undo now works when values are removed from a list through a CustomRemoveIndexFunction or a CustomRemoveElementFunction.
Fixed compiler error in Odin Project Validator in 2020.1 due to naming collision between the newly introduced UnityEditor.FilePath and Sirenix.OdinInspector.FilePathAttribute.
Odin Inspector Version 2.1.8
Additions
Editors rendered through an [InlineEditor] attribute are now drawn as disabled if they are drawing an asset that is locked through a version control system. This feature is on by default and can be toggled by InlineEditor's new DisableGUIForVCSLockedAssets member.
Fixes
Fixed EnumToggleButtons drawing in the 2019.3+ flat UI redesign. You can now see which values are selected again.
Fixed Odin's new, optimized DrawerUtilities static constructor throwing exceptions when a corrupt assembly is loaded due to having been broken by Unity's API updater.
Odin Inspector Version 2.1.7
Features
Buttons can now display the result of invoking them in the inspector - this is particularly useful in the static inspector. This new feature is enabled by default, and can be toggled in the General Drawer preferences under the General tab. The behaviour can also be toggled on or off on a case-by-case basis using the new DrawResult parameter on the [Button] attribute.
Optimization
Massive optimizations to Odin initialization - depending on your project, Odin might initialize several times faster than before. (That is, the lag spike you get the first time you open an inspector after a script reload should be a lot smaller.)
All LINQ has been removed completely from Odin's static initialization methods, and they have been hand-optimized to remove excess work.
Made all utility methods in TypeExtensions that check for implementations and get arguments of open generic types/classes/interfaces a lot faster.
Odin now uses Unity's TypeCache utility for faster reflection queries if it is present in the current Unity version.
TypeSearchIndex now keeps all indexed types in pre-sorted order, making search queries a bit faster since they don't need to be sorted after type matching has taken place.
OdinSerializeAttributeWarningDrawer no longer enters the drawer chain in cases where it would not be drawn.
Additions
Added OdinMenuStyle.LabelVerticalOffset.
Added UnityTypeCacheUtility class for using Unity's TypeCache utility if it is present in the current Unity version.
Odin Validator will now add its own scripting preprocessor define "ODIN_VALIDATOR" when it is installed. Similar to the ODIN_INSPECTOR define, the implementing code lives in a script called 'EnsureOdinValidatorDefine.cs', which contains well-commented code that the user can edit to suit their particular use case.
Fixes
Added compatibility with Unity 2020.1.0a14, where Unity changed EditorApplication.delayCall from a field to an event and changed the delegate type from EditorApplication.CallbackFunction to System.Action, breaking all assemblies compiled for earlier versions of Unity. This field/event is accessed through reflection now.
Fixed issue where the Getting Started window wouldn't load correctly at first in 2019.3.3f
[OnValueChanged] is now invoked when removing elements from a list through a CustomRemoveIndexFunction or CustomRemoveElementFunction applied with [ListDrawerSettings].
Fixed an issue where enabling Editor Only Mode would fail if it was faultily "partially" enabled, with script files already existing where they were supposed to be moved to.
Fixed case where Unity Object Preview Fields being displayed suddenly (such as when opening a dropdown) would sometimes cause an exception to be thrown due to no current window/view being set internally in Unity's GUI state.
Fixed error in the expression compiler where it would fail to resolve identifiers that referenced virtual properties with multiple implementations.
Fixed error where [DisplayAsText] with overflow set to false would have incorrect label padding, resulting in weird offsets compared to other labels.
Fixed the General Drawer settings 'Square Unity Object Alignment' and 'Enable Globally For' under tab 'Object Fields' not persisting properly across reloads when changed.
Fixed the SirenixEditorFields.FolderPathField(Rect, string, string, bool, bool) overload erroneously calling itself and causing a stack overflow exception - it now passes the call onto the correct overload.
Odin is now overall a lot better at detecting when a thrown exception has deeply nested ExitGUIExceptions as inner exceptions.
Odin will now not show buttons for generic method definitions, neither in the normal nor static inspector, since they cannot be invoked.
The [DrawWithUnity] attribute will now correctly cause the asset/scene to become dirty when its value is changed, in the case where Odin is the serialization backend of the displayed property.
The attribute overview will no longer break if an assembly is loaded that has broken metadata.
The ListDrawerSettings info box is now displayed properly at the top of the General drawer settings 'Collection' tab, instead of two properties down.
The TypeFilterAttributeDrawer no longer applies to (and throws exceptions for) properties that have no ValueEntry.
Unity-serialized dictionaries (via custom, hand-coded serialization methods) will no longer try to faultily register Odin prefab modifications when changed in prefab instances.
InlineEditor will now draw previews for GameObjects in the scene when preview is turned on.
Odin Inspector Version 2.1.6
Improvements
PrimitiveValueConflictDrawer, ReferencePathConflictDrawer and ReferenceValueConflictDrawer will no longer be part of the drawer chain for properties in a PropertyTree that has only one target, since conflicts cannot occur in those cases anyways.
Moved the AssemblyUtilities class from the Sirenix.Utilities assembly to the Sirenix.Utilities.Editor assembly. This is the first part of a planned drastic reduction in the contents of the Sirenix.Utilities assembly, which will end with it being stripped down to only GlobalConfig<T> and its direct dependencies.
Fixed a number of UI issues with Unity 2019.3+.
Fixes
Added extra safety around querying assemblies for types and attributes. Broken/invalid assemblies with bad metadata being loaded should no longer break any of the code that iterates over all loaded assemblies. This fixes the MissingMethodExceptions people were getting from the UnityAPICompatibilityVersion attribute when they installed various other plugins or packages for Unity.
Fixed issue where OnValueChanged callback would not be invoked on undo and redo.
Fixed null reference in File and FolderPath validators.
Fixed possible threading race condition in AssemblyUtilities initialization, that would sometimes cause a deadlock in old Unity runtimes (issue observed in Unity 5.6). The issue was that Thread.Join() does not seem to always work properly in old Unity Mono runtimes. A manual, "naive" thread join has been implemented instead.
Fixed typos in SirenixGUIStyles style names.
Odin Inspector Version 2.1.5
Optimization
The Cache<T> is now *significantly* faster at claiming and releasing cached values.
Improvements
Changed the priority of Odin's UnityEventDrawer to (0, 0, 0.45), so user code can declare a custom property drawer for UnityEvent and have it override Odin's UnityEventDrawer by default. This decision was made since Odin's drawer just draws the Unity event as it would have been drawn by Unity itself anyways, and therefore any global UnityEvent customization from a custom legacy property drawer should override Odin's drawer.
Made parts of the ImportSettingsConfig class public, so users with complex custom build pipelines can invoke it to automatically configure Odin's import settings at a time of their choosing.
The priority of legacy property drawers declared by Unity itself are now penalized by (0, 0, -0.1), so that legacy property drawers declared by user code have a higher priority by default.
Fixes
Attributes defined on interface type declarations now also gets included on members of that interface type.
Corrected DisplayAsString's documentation to correctly define the behaviour of the Overflow member.
Fixed a bug in TypeExtensions.TryInferGenericParameters, where it would sometimes succeed erroneously when given a partially constructed generic type, that has another partially constructed generic type as one of its constructed arguments.
Fixed a bug where dragging from various Odin rendered ObjectFields didn't work on Mac.
Fixed a bug where dragging to various Odin rendered object fields didn't always properly highlight that drop-zone when you're about to drop an item.
Fixed a bug where some attribute expressions wouldn't work on list elements.
Fixed bug where, in an OnValueChanged callback overload that takes the changed value as an argument, changes made to a 'this' struct instance in the callback would not be preserved.
Fixed error where value changes made during an invocation of [OnInspectorGUI] on a struct would be lost.
Fixed expression compiler error where using a unary operator such as '!' on the last "part" of a boolean expression of a ternary condition would cause the compiler to throw errors.
Fixed InspectorPropertyInfo.CreateValue not setting the order parameter that it is given on the resulting property info.
Fixed null reference in File and FolderPath validators.
Fixed subtle thread safety issue in Cache<T> where ICacheNotificationReceiver.OnFreed could be invoked during/after the cached instance had already been claimed again. This rare issue only happened in cases where the cache was really being soaked with claims and frees from many threads at once.
Methods invoked by clicking a button in the inspector no longer swallow all exceptions that are not an ExitGUIException.
Properties cached by path, that are no longer reachable when looked up, are now removed from the cache once their non-reachability is determined.
Removed errant debug log that would happen when a cached property is no longer reachable from the root.
Removed errant logging statement that happens when a property is found in a path lookup cache but is no longer reachable from the tree root.
Value changes made only through the SerializedProperty API in legacy CustomPropertyDrawers now correctly trigger invocation of the [OnValueChanged] attribute.
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.
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!
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!
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.
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.
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.
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.