Search Unity

[RELEASED] Odin Inspector & Serializer - The Ultimate Workflow Tool ★★★★★

Discussion in 'Assets and Asset Store' started by jorisshh, Jun 15, 2017.

  1. danbrani

    danbrani

    Joined:
    Nov 22, 2012
    Posts:
    46
    I switched to 2018.2b10 and these errors are appearing:
    upload_2018-6-28_23-39-58.png
    is there a fix for this yet?
     
    Last edited: Jun 29, 2018
  2. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,277
    Hello!

    In a odin drawer, I wish to draw a property, however it is not a "PropertyChildren".
    Is there a way to draw by inputting a class object instead of a PropertyChildren?
     
  3. TomaszKozera

    TomaszKozera

    Joined:
    Oct 18, 2017
    Posts:
    14
    When building the game we get this warning:
    Does anyone know what this means? How to fix it?
     
  4. TomaszKozera

    TomaszKozera

    Joined:
    Oct 18, 2017
    Posts:
    14
    I've come across yet another issue. When I use ValidateInput attribute for a field that is a list of objects then the validating function doesn't get called when second element in the list is changed. Surprisingly it works with first and third element, only the second one has an issue.

    Also - does anyone know if the developer is supporting this package anymore? I've posted a few questions that weren't answered, some for weeks now...
     
  5. bjarkeck

    bjarkeck

    Joined:
    Oct 26, 2014
    Posts:
    301
    Hello everyone here!

    Sorry for not getting back to you all, a lot of messages have piled up while we've been away, and prior to that we where not very active in here either. It's not the idéal place for support for us. It's a lot easier for us to give support from the Issue-Tracker, on Discord and from our website.

    Discord
    I would highly recommend you guys joining our Discord ;) We're much more active in there, and if we're not around, then there's a lot of other active and helpful people who're often willing to help.

    Isssue-Tracker
    If you have an issue that you don't want us to forget about, this is the place! If we see a blocking-issue, we'll prioritize it highly, and often do sweeps where we just go through all open issues.

    Sirenix.net/support
    If your question or inquiry is more suited for an email, this is the place! Here we also answer all messages!

    We'll continue to try and be active in here as well. But just know that there are alternatives if your question got unanswered.

    So yes we are active, we're working on the next major Odin Inspector release which will come with a ton of performance improvements and new features. So stay tuned!

    That sounds really strange, do you have a case that reproduces the issue? I can also send you our beta if you're willing to give that a shot to see if we've fixed the issue. If you PM me your invoice ID, I'll send it to you asap.

    Yup, pretty sure it is, I've send you a PM :)
     
  6. TomaszKozera

    TomaszKozera

    Joined:
    Oct 18, 2017
    Posts:
    14
    Thank you bjarkeck for a reply!

    I'm not able to get consistent repro on that one, I'll switch to discord and continue there.
     
  7. rubeng

    rubeng

    Joined:
    Apr 20, 2013
    Posts:
    60
    Hi, I am trying to add Odin Inspector little by little to my project, is it possible to enable odin inspector only on selected monobehaviours or scriptable objects? instead of having everything by default enabled?

    I would love to be able to add an attribute to a monobehaviour something like [UseOdinInspector] and have the default inspectors otherwise
     
  8. Tor-Vestergaard

    Tor-Vestergaard

    Joined:
    Mar 20, 2013
    Posts:
    188
    We don't have such an attribute - but you can go into Tools -> Odin Inspector -> Preferences -> Editor Types, and toggle Odin off for all the major top-level categories. This will default Odin to off for everything, and you can then switch it on selectively, by locating your particular types in the list and enabling them.
     
  9. Gamrek

    Gamrek

    Joined:
    Sep 28, 2010
    Posts:
    164
    Hello,

    After I upgraded the project to 2018.2, the inspector doesn't display stuff correctly. I am using Anti-Cheat and MasterAudio, and the inspector doesn't display them correctly. Can you help?

    Derek
     
  10. Tor-Vestergaard

    Tor-Vestergaard

    Joined:
    Mar 20, 2013
    Posts:
    188
    Could you give a more concrete example? Is there a reason you think Odin is related to this issue?
     
  11. samjoly

    samjoly

    Joined:
    Apr 23, 2013
    Posts:
    30
    I found one with UnityEvent. On Unity 2018.2, Odin displays the Event like in Debug Mode.
    I just did a quick test with a new project, but let me know if you need more details. Thanks
    UnityVersionWithOdin.gif
     
    Last edited: Jul 13, 2018
  12. bilke

    bilke

    Joined:
    Jul 13, 2012
    Posts:
    54
    Can you please share the fix?
     
  13. Gamrek

    Gamrek

    Joined:
    Sep 28, 2010
    Posts:
    164
    If I use "DrawWithUnity", the value display fine like attached, but if I remove it. It doesn't display correctly. This is using Anti-Cheat tool
     

    Attached Files:

  14. Gamrek

    Gamrek

    Joined:
    Sep 28, 2010
    Posts:
    164
    Plus, I have this annoying warning across the project.
     

    Attached Files:

  15. waxx

    waxx

    Joined:
    Apr 1, 2013
    Posts:
    48
    Sometimes when applying a prefab with a SerializedMonoBehaviour and a Dictionary (enum/Material), my values disappear and the dictionary becomes null. What am I missing?
     
  16. Tor-Vestergaard

    Tor-Vestergaard

    Joined:
    Mar 20, 2013
    Posts:
    188
    The warning/error you're getting is fixed in the beta. As for the other issue, I'll need a reproducing, stand-alone code example before I can be of any help. Please report it on our issue tracker, as this forum is really not the optimal platform for running support on.
     
  17. Tor-Vestergaard

    Tor-Vestergaard

    Joined:
    Mar 20, 2013
    Posts:
    188
    This issue is fixed in the beta - if you jump on Discord and send me a PM with your invoice ID, I'll send you a build with a fix.
     
  18. PlutDem

    PlutDem

    Joined:
    Dec 5, 2013
    Posts:
    4
    Hi, is there an easy way to show every property and field of an object without applying [ShowInInspector] attribute everywhere?
    Or something like this maybe?
    Code (CSharp):
    1. var myObject = new MySpecialObject();
    2. var memberInfos = myObject.GetType().GetMembers().Where( // filtering fields that we want to show
    3. var tree = PropertyTree.Create(myObject, memberInfos);
    4. tree.Draw(false);
     
  19. Gamrek

    Gamrek

    Joined:
    Sep 28, 2010
    Posts:
    164
    If it is getting a fix in next version, I can just wait until then. I am not in a rush. Thanks!
     
  20. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    After updating my project from 2017.4 to 2018.2 I always get these warnings when loading it:

    "Usual method of finding Sirenix plugin path failed. Fallback to folder pattern search... (This tends to happen when reimporting the project.)"

    and

    "Found Sirenix plugin path: Plugins/Sirenix/"

    How to get rid of those? I already tried removing Odin and reimporting it.
     
    deab likes this.
  21. Tor-Vestergaard

    Tor-Vestergaard

    Joined:
    Mar 20, 2013
    Posts:
    188
    Have you tried doing a full project reimport, by deleting the Library folder for example? That might help - this sort of thing often means that Odin's assemblies are somehow not being imported correctly.
     
  22. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    I have the same message as the previous user but I also have this issue with UnityEvents.
    I don't know that I can delete my library folder as it has created problems for me in the past.
    I'll try and post more about it later:


    Just updated to Unity 2018.2 from 2017 and I see that all my UnityEvents have been changed to this

    https://i.imgur.com/3bWuKJG.png

    With these 2 messages:
    1)

    Code (CSharp):
    1. Encountered the following exception when trying to instantiate a drawer of type UnityEventDrawer<UnityEvent>
    2. UnityEngine.Debug:Log(Object)
    3. Sirenix.OdinInspector.Editor.<>c__DisplayClass35_0:<GetAllDrawers>b__2(DrawerInfo)
    4. System.Linq.<CreateWhereIterator>c__Iterator1D`1:MoveNext()
    5. Sirenix.Utilities.<Append>d__19`1:MoveNext() (at F:/Sirenix/Sirenix Solution/Sirenix.Utilities/Extensions/LinqExtensions.cs:343)
    6. System.Linq.Enumerable:ToArray(IEnumerable`1)
    7. Sirenix.OdinInspector.Editor.DrawerLocator:GetAllDrawers(Type, Type, List`1, Boolean)
    8. Sirenix.OdinInspector.Editor.DrawerLocator:GetValueDrawers(Type) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:710)
    9. Sirenix.OdinInspector.Editor.DrawerLocator:GetDrawersForMemberInfo(MemberInfo, Type, Boolean) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:524)
    10. Sirenix.OdinInspector.Editor.DrawerLocator:GetDrawersForProperty(InspectorProperty) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:535)
    11. Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty, GUIContent)
    12. Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty)
    13. Sirenix.OdinInspector.Editor.InspectorUtilities:DrawPropertiesInTree(PropertyTree)
    14. Sirenix.OdinInspector.Editor.PropertyTree:Draw(Boolean)
    15. Sirenix.OdinInspector.Editor.OdinEditor:DrawTree() (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Children/PropertyValueCollection.cs:541)
    16. Sirenix.OdinInspector.Editor.OdinEditor:DrawOdinInspector() (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Children/PropertyValueCollection.cs:533)
    17. Sirenix.OdinInspector.Editor.OdinEditor:OnInspectorGUI() (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Children/PropertyValueCollection.cs:516)
    18. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    2)

    Code (CSharp):
    1. AmbiguousMatchException: Ambiguous matching in method resolution
    2. System.Reflection.Binder.FindMostDerivedMatch (System.Reflection.MethodBase[] match) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/Binder.cs:106)
    3. System.MonoType.GetMethodImpl (System.String name, BindingFlags bindingAttr, System.Reflection.Binder binder, CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/MonoType.cs:245)
    4. System.Type.GetMethod (System.String name, BindingFlags bindingAttr) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Type.cs:787)
    5. Sirenix.OdinInspector.Editor.UnityPropertyHandlerUtility..cctor () (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Context/PropertyContext.cs:60)
    6. Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Sirenix.OdinInspector.Editor.UnityPropertyHandlerUtility
    7. Sirenix.OdinInspector.Editor.UnityPropertyDrawer`2[UnityEditorInternal.UnityEventDrawer,UnityEngine.Events.UnityEvent]..ctor ()
    8. Sirenix.OdinInspector.Editor.Drawers.UnityEventDrawer`1[UnityEngine.Events.UnityEvent]..ctor () (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/Vector4Drawer.cs:66)
    9. System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:513)
    10. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    11. System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:519)
    12. System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:528)
    13. System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/ConstructorInfo.cs:77)
    14. System.Activator.CreateInstance (System.Type type, Boolean nonPublic) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Activator.cs:372)
    15. System.Activator.CreateInstance (System.Type type) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Activator.cs:254)
    16. Sirenix.OdinInspector.Editor.DrawerLocator.GetDrawer (System.Type drawerType, Boolean forceUniqueDrawerInstance)
    17. Sirenix.OdinInspector.Editor.DrawerLocator+<>c__DisplayClass35_0.<GetAllDrawers>b__2 (Sirenix.OdinInspector.Editor.DrawerInfo info)
    18. UnityEngine.Debug:LogException(Exception)
    19. Sirenix.OdinInspector.Editor.<>c__DisplayClass35_0:<GetAllDrawers>b__2(DrawerInfo)
    20. System.Linq.<CreateWhereIterator>c__Iterator1D`1:MoveNext()
    21. Sirenix.Utilities.<Append>d__19`1:MoveNext() (at F:/Sirenix/Sirenix Solution/Sirenix.Utilities/Extensions/LinqExtensions.cs:343)
    22. System.Linq.Enumerable:ToArray(IEnumerable`1)
    23. Sirenix.OdinInspector.Editor.DrawerLocator:GetAllDrawers(Type, Type, List`1, Boolean)
    24. Sirenix.OdinInspector.Editor.DrawerLocator:GetValueDrawers(Type) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:710)
    25. Sirenix.OdinInspector.Editor.DrawerLocator:GetDrawersForMemberInfo(MemberInfo, Type, Boolean) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:524)
    26. Sirenix.OdinInspector.Editor.DrawerLocator:GetDrawersForProperty(InspectorProperty) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:535)
    27. Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty, GUIContent)
    28. Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty)
    29. Sirenix.OdinInspector.Editor.InspectorUtilities:DrawPropertiesInTree(PropertyTree)
    30. Sirenix.OdinInspector.Editor.PropertyTree:Draw(Boolean)
    31. Sirenix.OdinInspector.Editor.OdinEditor:DrawTree() (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Children/PropertyValueCollection.cs:541)
    32. Sirenix.OdinInspector.Editor.OdinEditor:DrawOdinInspector() (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Children/PropertyValueCollection.cs:533)
    33. Sirenix.OdinInspector.Editor.OdinEditor:OnInspectorGUI() (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Children/PropertyValueCollection.cs:516)
    34. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
     
  23. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    I deleted the Library folder. That didn't fix it.
     
  24. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    I deleted it too and it didnt fix it.
     
  25. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    After updating to Unity 2018.2.1f1 I'm getting a strange error when opening scenes where I use Odin in lots of inspectors - but I'm not sure if it's actually triggered by Odin. I'm fairly sure I'm not using Odin serialization features, only inspectors, so I lean towards blaming this on Unity based on the text of the error, but its probably worth asking you just in case, since you have more experience with this:

    Code (csharp):
    1.  
    2. UnityException: set_type is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'ObjectSelector'.
    3. See "Script Serialization" page in the Unity Manual for further details.
    4. UnityEngine.Event.KeyboardEvent (System.String key) (at C:/buildslave/unity/build/Modules/IMGUI/Event.cs:153)
    5. UnityEditor.ObjectSelector..cctor () (at C:/buildslave/unity/build/Editor/Mono/ObjectSelector.cs:78)
    6. Rethrow as TypeInitializationException: An exception was thrown by the type initializer for UnityEditor.ObjectSelector
    7. UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget(String)
    8. UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean)
    9.  
    In addition, Odin is no longer remember its location, it seems - every single startup, it reports that Odin wasn't found and then prints this into log when it rediscovers a correct location. Might be some minor issue with path saving not triggering correctly?

    Code (csharp):
    1.  
    2. Found Sirenix plugin path: Plugins/Sirenix/
    3. UnityEngine.Debug:Log(Object)
    4. Sirenix.Utilities.SirenixAssetPaths:.cctor() (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Misc/SirenixAssetPaths.cs:87)
    5. Sirenix.Utilities.SirenixGlobalConfigAttribute:.ctor() (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Misc/SirenixGlobalConfigAttribute.cs:22)
    6. Sirenix.Utilities.SirenixGlobalConfigAttribute:.ctor() (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Misc/SirenixGlobalConfigAttribute.cs:20)
    7. System.MonoType:GetCustomAttributes(Type, Boolean)
    8. Sirenix.Utilities.TypeExtensions:GetCustomAttributes(Type, Boolean) (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Extensions/TypeExtensions.cs:1179)
    9. Sirenix.Utilities.TypeExtensions:GetCustomAttribute(Type, Boolean) (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Extensions/TypeExtensions.cs:1150)
    10. Sirenix.Utilities.TypeExtensions:GetCustomAttribute(Type) (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Extensions/TypeExtensions.cs:1160)
    11. Sirenix.Utilities.GlobalConfig`1:get_ConfigAttribute() (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Misc/GlobalConfig.cs:50)
    12. Sirenix.Utilities.GlobalConfig`1:LoadInstanceIfAssetExists() (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Misc/GlobalConfig.cs:169)
    13. Sirenix.Serialization.UnitySerializationInitializer:Initialize() (at D:/Sirenix/Sirenix Solution/Sirenix.Serialization/Utilities/PrefabModification.cs:522)
    14. Sirenix.Serialization.UnitySerializationInitializer:InitializeEditor() (at D:/Sirenix/Sirenix Solution/Sirenix.Serialization/Utilities/ProperBitConverter.cs:49)
    15. UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()
     
    io-games likes this.
  26. SugoiDev

    SugoiDev

    Joined:
    Mar 27, 2013
    Posts:
    395
    Did you guys ever get around to finish those? I was just implementing it and remembered I had seen your implementation a while ago!
     
  27. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    I get the same error as bac9-flcl now and then. And some error when I try to display my own PropertyDrawer.

    I hope this gets fixed soon, right now Odin is very annoying :-/
     
  28. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    On another subject - it looks like replacements of default drawers by Odin ceased to work on some properties utilized in Time of Day package. They are probably not unique, but that's where I encountered the issue. It manifests as a spam of two messages in the editor log:

    Code (csharp):
    1.  
    2. Encountered the following exception when trying to instantiate a drawer of type UnityPropertyAttributeDrawer<TOD_RangeDrawer, TOD_RangeAttribute, PropertyAttribute>
    3. UnityEngine.Debug:Log(Object)
    4. Sirenix.OdinInspector.Editor.<>c__DisplayClass35_0:<GetAllDrawers>b__2(DrawerInfo)
    5. System.Linq.<CreateWhereIterator>c__Iterator1D`1:MoveNext()
    6. Sirenix.Utilities.<Append>d__19`1:MoveNext() (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Extensions/LinqExtensions.cs:343)
    7. System.Linq.Enumerable:ToArray(IEnumerable`1)
    8. Sirenix.OdinInspector.Editor.DrawerLocator:GetAllDrawers(Type, Type, List`1, Boolean) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorValuePropertyInfo.cs:159)
    9. Sirenix.OdinInspector.Editor.DrawerLocator:GetAttributeDrawers(Type, Type, Boolean)
    10. Sirenix.OdinInspector.Editor.DrawerLocator:GetDrawersForMemberInfo(MemberInfo, Type, Boolean) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:1272)
    11. Sirenix.OdinInspector.Editor.DrawerLocator:GetDrawersForProperty(InspectorProperty) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:27)
    12. Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty, GUIContent) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:16)
    13. Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:72)
    14. Sirenix.OdinInspector.Editor.InspectorUtilities:DrawPropertiesInTree(PropertyTree) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:65)
    15. Sirenix.OdinInspector.Editor.PropertyTree:Draw(Boolean) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Attribute Drawers/DisableInEditorModeAttributeDrawer.cs:30)
    16. Sirenix.OdinInspector.Editor.OdinEditor:DrawTree() (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Context/PropertyContextContainer.cs:95)
    17. Sirenix.OdinInspector.Editor.OdinEditor:DrawOdinInspector() (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Context/PropertyContextContainer.cs:80)
    18. Sirenix.OdinInspector.Editor.OdinEditor:OnInspectorGUI() (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Context/PropertyContextContainer.cs:54)
    19. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    Code (csharp):
    1.  
    2. AmbiguousMatchException: Ambiguous matching in method resolution
    3. System.Reflection.Binder.FindMostDerivedMatch (System.Reflection.MethodBase[] match) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/Binder.cs:106)
    4. System.MonoType.GetMethodImpl (System.String name, BindingFlags bindingAttr, System.Reflection.Binder binder, CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/MonoType.cs:245)
    5. System.Type.GetMethod (System.String name, BindingFlags bindingAttr) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Type.cs:787)
    6. Sirenix.OdinInspector.Editor.UnityPropertyHandlerUtility..cctor () (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Context/PropertyContextContainer.cs:273)
    7. Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Sirenix.OdinInspector.Editor.UnityPropertyHandlerUtility
    8. Sirenix.OdinInspector.Editor.UnityPropertyAttributeDrawer`3[TOD_RangeDrawer,TOD_RangeAttribute,UnityEngine.PropertyAttribute]..ctor () (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Context/PropertyContextContainer.cs:196)
    9. System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:513)
    10. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    11. System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:519)
    12. System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:528)
    13. System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/ConstructorInfo.cs:77)
    14. System.Activator.CreateInstance (System.Type type, Boolean nonPublic) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Activator.cs:372)
    15. System.Activator.CreateInstance (System.Type type) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Activator.cs:254)
    16. Sirenix.OdinInspector.Editor.DrawerLocator.GetDrawer (System.Type drawerType, Boolean forceUniqueDrawerInstance) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:40)
    17. Sirenix.OdinInspector.Editor.DrawerLocator+<>c__DisplayClass35_0.<GetAllDrawers>b__2 (Sirenix.OdinInspector.Editor.DrawerInfo info)
    18. UnityEngine.Debug:LogException(Exception)
    19. Sirenix.OdinInspector.Editor.<>c__DisplayClass35_0:<GetAllDrawers>b__2(DrawerInfo)
    20. System.Linq.<CreateWhereIterator>c__Iterator1D`1:MoveNext()
    21. Sirenix.Utilities.<Append>d__19`1:MoveNext() (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Extensions/LinqExtensions.cs:343)
    22. System.Linq.Enumerable:ToArray(IEnumerable`1)
    23. Sirenix.OdinInspector.Editor.DrawerLocator:GetAllDrawers(Type, Type, List`1, Boolean) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorValuePropertyInfo.cs:159)
    24. Sirenix.OdinInspector.Editor.DrawerLocator:GetAttributeDrawers(Type, Type, Boolean)
    25. Sirenix.OdinInspector.Editor.DrawerLocator:GetDrawersForMemberInfo(MemberInfo, Type, Boolean) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:1272)
    26. Sirenix.OdinInspector.Editor.DrawerLocator:GetDrawersForProperty(InspectorProperty) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:27)
    27. Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty, GUIContent) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:16)
    28. Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:72)
    29. Sirenix.OdinInspector.Editor.InspectorUtilities:DrawPropertiesInTree(PropertyTree) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:65)
    30. Sirenix.OdinInspector.Editor.PropertyTree:Draw(Boolean) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Attribute Drawers/DisableInEditorModeAttributeDrawer.cs:30)
    31. Sirenix.OdinInspector.Editor.OdinEditor:DrawTree() (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Context/PropertyContextContainer.cs:95)
    32. Sirenix.OdinInspector.Editor.OdinEditor:DrawOdinInspector() (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Context/PropertyContextContainer.cs:80)
    33. Sirenix.OdinInspector.Editor.OdinEditor:OnInspectorGUI() (at D:/Sirenix/Sirenix
    That wasn't an issue before 2018.2.1f1, I think.
     
  29. Shnayzr

    Shnayzr

    Joined:
    Aug 31, 2014
    Posts:
    18
    How can I choose to either make a value constant or random between two constant in the inspector? Similar to the Particle System Inspector
     
  30. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    Does your UnityEvent from your script still show properly? I have the same errors and I don't have a proper display in the inspector of any UnityEvent.
     
  31. ryo0ka

    ryo0ka

    Joined:
    Sep 27, 2015
    Posts:
    37
    Hi, hoping this will be a quick question --

    I'm trying to create a custom drawer for
    ReactiveProperty<T>
    in UniRx, which is basically just a wrapper class for one generic property as in:

    Code (CSharp):
    1. [Serializable]
    2. class ReactiveProperty<T>
    3. {
    4.    [SerializedField]
    5.    public T value;
    6. }
    which is used like in this code:

    Code (CSharp):
    1. public class States : ScriptableObject
    2. {
    3.     [SerializeField]
    4.     AppStateReactiveProperty _app;
    5.  
    6.     [SerializeField]
    7.     BooleanReactiveProperty _paused;
    8.  
    9.     [Serializable]
    10.     class AppStateReactiveProperty : ReactiveProperty<AppStateTypes> {}
    11.  
    12.     [Serializable]
    13.     class BooleanReactiveProperty : ReactiveProperty<bool> { }
    14. }
    looks like this in the inspector:



    In my goal, it has to look like this (i.e. removing the "Value" prefix and making it one-line):



    Now, I'm struggling to draw the generic field (of "value") with updating it via user input.

    This is my code at the moment:

    Code (CSharp):
    1. [OdinDrawer]
    2. public class ReactivePropertyOdinDrawer<R, T> : OdinValueDrawer<R> where R: IReactiveProperty<T>
    3. {
    4.     protected override void DrawPropertyLayout(IPropertyValueEntry<R> entry, GUIContent label)
    5.     {
    6.        // Draw the prefix label:
    7.         Rect _rect = EditorGUILayout.GetControlRect();
    8.  
    9.         if (label != null)
    10.         {
    11.             _rect = EditorGUI.PrefixLabel(_rect, label);
    12.         }
    13.  
    14.         T value = entry.SmartValue.value;
    15.      
    16.        // How do you draw "value" and also update SmartValue with user input???
    17.        entry.SmartValue.value = Blablablablabla.SomeMethodToDrawGenericField(value);
    18.     }
    19. }
    Thank you in advance!
    Ryo
     
    gareth_untether likes this.
  32. PIGSSS-GAMES

    PIGSSS-GAMES

    Joined:
    Jul 2, 2014
    Posts:
    8
    I got IL2CPP error. about AOTGenerated.PreventCodeStrippingViaReferences when try to build xcode project in Unity 2018.2.1f1. couldn't build on other version of Unity as well but the error was about System.String <>__AnonType1`2::ToString() the Odin version is 1.0.6.9

    Code (CSharp):
    1. IL2CPP error for method 'System.Void Sirenix.Serialization.AOTGenerated.PreventCodeStrippingViaReferences::.cctor()' in assembly '/Users/PigsssGames01/Desktop/Work Projects/Vera/Unity/Temp/StagingArea/Data/Managed/Sirenix.Serialization.AOTGenerated.dll'
    2. Additional information: Build a development build for more information. Exception has been thrown by the target of an invocation.
    3. il2cpp.exe didn't catch exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: Exception of type 'System.Exception' was thrown.
    4.   at Unity.IL2CPP.GenericsCollection.Inflater.InflateType(GenericContext context, TypeReference typeReference)
    5.   at Unity.IL2CPP.GenericsCollection.Inflater.ConstructGenericType(GenericContext context, TypeDefinition typeDefinition, IEnumerable`1 genericArguments)
     
  33. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    I don't use Unity events so I'm not sure if they are related to this at all.
     
  34. TFgamesOG

    TFgamesOG

    Joined:
    Jun 2, 2017
    Posts:
    16
    What might be the cause of the following warning?

    Code (csharp):
    1. Usual method of finding Sirenix plugin path failed. Fallback to folder pattern search... (This tends to happen when reimporting the project.)
    2. UnityEngine.Debug:LogWarning(Object)
    3. Sirenix.Utilities.SirenixAssetPaths:.cctor() (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Misc/SirenixAssetPaths.cs:81)
    4. System.Object:__icall_wrapper_mono_generic_class_init(IntPtr)
    5. Sirenix.Utilities.SirenixGlobalConfigAttribute:.ctor() (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Misc/SirenixGlobalConfigAttribute.cs:20)
    6. System.RuntimeType:GetCustomAttributes(Type, Boolean)
    7. Sirenix.Utilities.TypeExtensions:GetCustomAttributes(Type, Boolean) (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Extensions/TypeExtensions.cs:1179)
    8. Sirenix.Utilities.TypeExtensions:GetCustomAttribute(Type, Boolean) (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Extensions/TypeExtensions.cs:1150)
    9. Sirenix.Utilities.TypeExtensions:GetCustomAttribute(Type) (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Extensions/TypeExtensions.cs:1160)
    10. Sirenix.Utilities.GlobalConfig`1:get_ConfigAttribute() (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Misc/GlobalConfig.cs:50)
    11. Sirenix.Utilities.GlobalConfig`1:LoadInstanceIfAssetExists() (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Misc/GlobalConfig.cs:169)
    12. Sirenix.Serialization.UnitySerializationInitializer:Initialize() (at D:/Sirenix/Sirenix Solution/Sirenix.Serialization/Utilities/PrefabModification.cs:522)
    13. Sirenix.Serialization.UnitySerializationInitializer:InitializeEditor() (at D:/Sirenix/Sirenix Solution/Sirenix.Serialization/Utilities/ProperBitConverter.cs:49)
    14. UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()
    It can find it with the fallback-method:

    Code (CSharp):
    1. Found Sirenix plugin path: Plugins/Sirenix/
    2. UnityEngine.Debug:Log(Object)
    3. Sirenix.Utilities.SirenixAssetPaths:.cctor() (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Misc/SirenixAssetPaths.cs:87)
    4. System.Object:__icall_wrapper_mono_generic_class_init(IntPtr)
    5. Sirenix.Utilities.SirenixGlobalConfigAttribute:.ctor() (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Misc/SirenixGlobalConfigAttribute.cs:20)
    6. System.RuntimeType:GetCustomAttributes(Type, Boolean)
    7. Sirenix.Utilities.TypeExtensions:GetCustomAttributes(Type, Boolean) (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Extensions/TypeExtensions.cs:1179)
    8. Sirenix.Utilities.TypeExtensions:GetCustomAttribute(Type, Boolean) (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Extensions/TypeExtensions.cs:1150)
    9. Sirenix.Utilities.TypeExtensions:GetCustomAttribute(Type) (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Extensions/TypeExtensions.cs:1160)
    10. Sirenix.Utilities.GlobalConfig`1:get_ConfigAttribute() (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Misc/GlobalConfig.cs:50)
    11. Sirenix.Utilities.GlobalConfig`1:LoadInstanceIfAssetExists() (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities/Misc/GlobalConfig.cs:169)
    12. Sirenix.Serialization.UnitySerializationInitializer:Initialize() (at D:/Sirenix/Sirenix Solution/Sirenix.Serialization/Utilities/PrefabModification.cs:522)
    13. Sirenix.Serialization.UnitySerializationInitializer:InitializeEditor() (at D:/Sirenix/Sirenix Solution/Sirenix.Serialization/Utilities/ProperBitConverter.cs:49)
    14. UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()
     
  35. bjarkeck

    bjarkeck

    Joined:
    Oct 26, 2014
    Posts:
    301
    Odin Inspector 2.0 will be released very soon! And it'll solve all of the above problems, and provide proper support for the latest Unity version, and a lot more good stuff you can look forward too.

    So anyone having trouble with Odin and 2018.2x, please hold on a little while longer. We expect to submit the patch to the Asset Store next week. You're also welcome to PM me your Odin Inspector Invoice ID, if you want me to send you the release candidate now.

    You could use the InlineProperty attribute for that :) Together with HideLabel

    Code (CSharp):
    1.  
    2. [InlineProperty]
    3. class ReactiveProperty<T>
    4. {
    5.    [SerializedField, HideLabel]
    6.    public T value;
    7. }
    8.  
    Does that work for you?
     
    gareth_untether likes this.
  36. bjarkeck

    bjarkeck

    Joined:
    Oct 26, 2014
    Posts:
    301
    Not seen this one before, Would you mind posting that on our Issue-Tracker?
     
  37. PIGSSS-GAMES

    PIGSSS-GAMES

    Joined:
    Jul 2, 2014
    Posts:
    8
  38. TFgamesOG

    TFgamesOG

    Joined:
    Jun 2, 2017
    Posts:
    16
    I'm having the following simple script:

    Code (CSharp):
    1. using Sirenix.OdinInspector.Editor;
    2. using UnityEditor;
    3. using UnityEngine;
    4.  
    5. namespace KordexEditor
    6. {
    7.     public class TmpEditorWindow : OdinEditorWindow
    8.     {
    9.         [SerializeField]
    10.         private float test;
    11.         [SerializeField]
    12.         private float test2;
    13.  
    14.         [MenuItem("Kordex/Windows/Tmp")]
    15.         public static void OpenPropPainterWindow()
    16.         {
    17.             GetWindow<TmpEditorWindow>();
    18.         }
    19.     }
    20. }
    Why does the Editor Window change the scene when I change the values Test or Test2?

     
  39. candycat

    candycat

    Joined:
    Jun 5, 2014
    Posts:
    29
    I got errors in Unity 2018.2:
    Any way to fix that?
     
  40. mSkull

    mSkull

    Joined:
    Apr 19, 2016
    Posts:
    11
    Have you upgraded to Odin Inspector 2.0 yet? This version was released yesterday and should contain the fix for this issue.
    You can see the release notes here: http://sirenix.net/odininspector/releasenotes
     
  41. mSkull

    mSkull

    Joined:
    Apr 19, 2016
    Posts:
    11
    I would guess be that the scene is not actually changed, but just marked as dirty. Marking the scene as dirty means that Unity will think there are changes, and will, therefore, let the user save the scene, but there might not actually be any changes.

    One of the most common our users have run into is with things not being marked as dirty, for various reasons, after they have changed some property. To counter this, we now mark stuff as dirty more liberally. As a just in case measure.
     
  42. TFgamesOG

    TFgamesOG

    Joined:
    Jun 2, 2017
    Posts:
    16
    I see... thanks for the clarification. I just wanted to make sure, that Odin isn't changing anything unexpectedly ^^
     
  43. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hi,I've just updated to odin 2.0 from 1.0.6
    and my foldout dictionaries got shown like this:
    upload_2018-8-13_17-7-40.png
    The key label is overloapped on my actualy key field, is this a known issue? Or is it something I did wrong?
     
  44. bjarkeck

    bjarkeck

    Joined:
    Oct 26, 2014
    Posts:
    301
    Nope, you didn't do anything wrong at all. That's a bug so thanks for reporting, we'll see to it in the next hotfix - patch 2.0.2.
     
  45. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Great! Look forward to the hotfix!
     
  46. io-games

    io-games

    Joined:
    Jun 2, 2016
    Posts:
    104
    It seems scriptableobjects does not work correctly in unity 2018.2.0f2
    odin version 2.0.1

    Code (CSharp):
    1.  
    2. UnityException: set_type is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'ObjectSelector'.
    3. See "Script Serialization" page in the Unity Manual for further details.
    4. Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.ObjectSelector' threw an exception.
    5. Rethrow as OdinPropertyException: This error occurred while being drawn by Odin.
    6. Odin Property Path: currentRecipe
    7. Odin Drawer Chain:
    8. > PropertyContextMenuDrawer<CraftRecipe>
    9. > ReferencePathConflictDrawer<CraftRecipe>
    10. > ReferenceValueConflictDrawer<CraftRecipe>
    11. > UnityObjectDrawer<CraftRecipe>
    12. > CompositeDrawer.
    13.  
    Stacktrace
    https://yadi.sk/i/Ad2NfXpw3aFRns

    UPD Restarted Unity and it works now.
     
    Last edited: Aug 15, 2018
  47. bjarkeck

    bjarkeck

    Joined:
    Oct 26, 2014
    Posts:
    301
    Here there, this issue should be fixed in the latest version. Are you sure you have the latest release? try opening Tool > Odin Inspector > About and see what version you have.

    The Unity Asset Store is currently struggling and a lot of people, including our self, have problems getting it to update to the latest version. We've done all we can on our end, so until Unity fixes it, everyone is welcome to send us a message with your Odin invoice ID and we'll send you the latest build.

    If you have indeed somehow updated to 2.0.1 and still have the bug, then check out the yellow box from our 2.0 release notes:

    http://sirenix.net/odininspector/releasenotes
     
  48. bjarkeck

    bjarkeck

    Joined:
    Oct 26, 2014
    Posts:
    301
    Hey, thought I knew what was going out but turns out I didn't.

    Could you share the code that reproduces that bug? And also, could you go into Tools > Odin Inspector > About and verify your version?
     
  49. io-games

    io-games

    Joined:
    Jun 2, 2016
    Posts:
    104
    Thank you for reply!

    I updated from asset store, it shows 2.0.1 but in unity you can see about window below
    upload_2018-8-17_8-54-13.png

    But I restarted unity after odin update and problem gone.

    BTW. Thank you for great asset! It's huge time saver :)
     

    Attached Files:

  50. joaobsneto

    joaobsneto

    Joined:
    Dec 10, 2009
    Posts:
    152
    Why "TagSelector" Attribute is missing in 2.0.0? Is there a substitute?