Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Released] Expanding Unity inspector and serialization system

Discussion in 'Assets and Asset Store' started by llamagod, Jan 20, 2017.

  1. llamagod

    llamagod

    Joined:
    Sep 27, 2015
    Posts:
    76
    Have you ever been in a situation where you wanted to display properties, dictionaries or polymorphic types in the inspector and then wasted tons of time restructuring and making unstable workarounds?
    I sure have.
    I have come to the understanding that especially serialization of polymorphic types is a very requested feature: https://feedback.unity3d.com/suggestions/serialization-of-polymorphic-dat

    That's why I sat down and wrote a system that enables you to display pretty much anything in the inspector and it will serialize.

    You can get the asset here: https://www.assetstore.unity3d.com/en/#!/content/79135
    Sorry for the messy layout, I tend to focus more on the content than the presentation, I'm a scripter, not an artist.

    I hope you will be interested in my solution to this fundamental problem, if not tell me why. I will use your feedback to improve upon my solution.

    The features include:
    • Polymorphism
    • Display properties
    • Display get-only properties
    • Display generic types
    • Dictionaries
    • Polymorphic dictionary keys
    • HashSets
    • Nest lists, arrays and dictionaries within each other to no limit (Multi-dimensional arrays and lists)
    • Display lambda Action delegates with ActionData. Allows up to 4 arguments
    • Display events with EventData
    • Create your own property drawers for these custom serialized variables
    • Enables use of built-in decorator drawers on custom serialized variables
    • Downcast variables to interfaces and abstract types with user-defined default types
    • Manage these custom serialized variables through a CustomSerializedObject in your custom inspectors

    Thank you for your time :)
     
    junglemason likes this.
  2. junglemason

    junglemason

    Joined:
    Dec 30, 2010
    Posts:
    69
    Looks great! But I get this compilation error:

    Assets/Inspector Display Anything/Assets/Scripts/Extensions.cs(666,31): error CS7069: Reference to type `System.ComponentModel.INotifyPropertyChanging' claims it is defined assembly `System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089', but it could not be found​

    (fresh empty project, Unity 5.5.1f1)
     
    Last edited: Apr 4, 2017
  3. llamagod

    llamagod

    Joined:
    Sep 27, 2015
    Posts:
    76
    Thank you for purchasing this asset and for bringing this to my attention.
    Under "Playersettings" change "Api Compatability Level" from ".NET 2.0 Subset" to ".NET 2.0" and the error should disappear.

    If you have any other questions or problems I will help you ASAP.
     
    junglemason likes this.
  4. junglemason

    junglemason

    Joined:
    Dec 30, 2010
    Posts:
    69
    Confirmed. Thanks!
     
  5. junglemason

    junglemason

    Joined:
    Dec 30, 2010
    Posts:
    69
    Next up: in the Example scene, when I change an array size and hit the Enter key, I get this error:

    Type: not found. Maybe you need to write the namespace.
    UnityEngine.Debug:LogError(Object)
    EditorExtensions:CustomPropertyField(Rect, CustomSerializedProperty, Boolean) (at Assets/Inspector Display Anything/Assets/Editor/EditorExtensions.cs:175)
    EditorExtensions:CustomObjectField(Rect, CustomSerializedObject) (at Assets/Inspector Display Anything/Assets/Editor/EditorExtensions.cs:103)
    EditorExtensions:CustomObjectFieldLayout(CustomSerializedObject) (at Assets/Inspector Display Anything/Assets/Editor/EditorExtensions.cs:84)
    CustomSerializableInspector:OnInspectorGUI() (at Assets/Inspector Display Anything/Assets/Editor/CustomSerializableInspector.cs:26)
    UnityEditor.DockArea:OnGUI()
     
  6. llamagod

    llamagod

    Joined:
    Sep 27, 2015
    Posts:
    76
    That is a bug regarding the type field, it wasn't checking whether or not it was the currently selected control, so it just threw the error every time you press enter. Replace the EditorExtensions.cs file with the file I have attached, it should solve the problem. Let's take this to the private chat if you discover more bugs. When you feel like the asset is stable I will upload the fixed package, so everyone can enjoy these fixes. Thank you for your patience.
     

    Attached Files:

    junglemason likes this.
  7. junglemason

    junglemason

    Joined:
    Dec 30, 2010
    Posts:
    69
    Will do, happy to help.