Toggles demo doesn't behave as expected

Issue #236 duplicate
Maurizio Margiotta
created an issue

In the scene "1 - Odin Attributes Overview" the toggle sample shows the same thing for all the Three, Four and Fice toggles. The extended classes have some additional fields that are not appearing in the inspector.

Also in the last Toggle List, I can't reorder the values. After dragging one, it returns to the original position as soon as I release the button.

And last, but not least, if I try to change the "Test" value of one of the elements of the Toggle List by dragging on the small up/down arrows, doing very fast it starts a drag action, that also fails with this exception:

No Drag&Drop has been setup. Please
UnityEditor.DragAndDrop:StartDrag(String)
Sirenix.Utilities.Editor.DragHandle:Update() (at C:/Sirenix/Sirenix Solution/Sirenix.Utilities.Editor/GUI/DragAndDrop/DragHandle.cs:161)
Sirenix.Utilities.Editor.DragAndDropManager:EndDragHandle() (at C:/Sirenix/Sirenix Solution/Sirenix.Utilities.Editor/GUI/DragAndDrop/DragAndDropManager.cs:147)
Sirenix.OdinInspector.Editor.Drawers.ListDrawer`2:EndDragHandle(ListDrawerConfigInfo, Int32)
Sirenix.OdinInspector.Editor.Drawers.ListDrawer`2:DrawItems(ListDrawerConfigInfo) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/Vector2Drawer.cs:65)
Sirenix.OdinInspector.Editor.Drawers.ListDrawer`2:DrawPropertyLayout(IPropertyValueEntry`1, GUIContent) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/Vector2Drawer.cs:59)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawProperty(IPropertyValueEntry`1, GUIContent) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:1065)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawPropertyImplementation(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:283)
Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.Drawers.NullableReferenceDrawer`1:DrawPropertyLayout(IPropertyValueEntry`1, GUIContent)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawProperty(IPropertyValueEntry`1, GUIContent) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:1065)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawPropertyImplementation(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:283)
Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.Drawers.ReferenceValueConflictDrawer`1:DrawPropertyLayout(IPropertyValueEntry`1, GUIContent) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/PropertyContextMenuDrawer.cs:302)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawProperty(IPropertyValueEntry`1, GUIContent) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:1065)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawPropertyImplementation(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:283)
Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.Drawers.ReferencePathConflictDrawer`1:DrawPropertyLayout(IPropertyValueEntry`1, GUIContent) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/PropertyContextMenuDrawer.cs:249)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawProperty(IPropertyValueEntry`1, GUIContent) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:1065)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawPropertyImplementation(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:283)
Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(IPropertyValueEntry, GUIContent)
Sirenix.OdinInspector.Editor.Drawers.FixUnityNullDrawer`1:DrawPropertyLayout(IPropertyValueEntry`1, GUIContent)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawProperty(IPropertyValueEntry`1, GUIContent) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:1065)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawPropertyImplementation(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:283)
Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.Drawers.ReferenceDrawer`1:DrawPropertyLayout(IPropertyValueEntry`1, GUIContent)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawProperty(IPropertyValueEntry`1, GUIContent) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:1065)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawPropertyImplementation(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:283)
Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(IPropertyValueEntry, GUIContent)
Sirenix.OdinInspector.Editor.Drawers.PropertyContextMenuDrawer`1:DrawPropertyLayout(IPropertyValueEntry`1, GUIContent)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawProperty(IPropertyValueEntry`1, GUIContent) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:1065)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawPropertyImplementation(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:283)
Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty, GUIContent) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:601)
Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:527)
Sirenix.OdinInspector.Editor.InspectorUtilities:DrawPropertiesInTree(PropertyTree) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:520)
Sirenix.OdinInspector.Editor.PropertyTree:Draw(Boolean) (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Utilities/Persistent/PersistentContextCache.cs:182)
Sirenix.OdinInspector.Editor.OdinEditor:OnInspectorGUI() (at C:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Misc/DrawerPriority.cs:380)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Odin version 1.0.5.3 Unity version: 2017.2.0f3 on macOS Sierra 10.12.6

Comments (5)

  1. mSkull001

    For the first issue, the weird behaviour was caused by Unity only serializing what was in the base class, and therefore only the base class properties were drawn in the inspector. I've fixed this by changing the fields to their concrete type, instead of using polymorphism.

    For the second issue, I have been unable to replicate this in 1.0.6.0. I have however not been to test the issue on a mac. If you contact us by mail with your invoice number, we can send you the latest package if you'd like to test the issue with that patch.

    For the third issue, I believe this has been solved in 1.0.6.0, by only allowing list elements to be dragged by the drag handle. I've also been unable to replicate the issue described in 1.0.6.0.

    We have also been implementing a new drag and drop API and will likely be converting the list drawer to this system in patch 1.1.

  2. Log in to comment