Search Unity

Entity Inspector and custom types

Discussion in 'Entity Component System' started by threedots1, Nov 2, 2019.

  1. threedots1

    threedots1

    Joined:
    Oct 9, 2014
    Posts:
    88
    I've searched the forum but haven't found much useful in regards to this.

    Looking at the source code, everything is set internal and I don't think I can create a custom display in the debugger for my type.

    I'm using a struct with a couple of ulong [Flags] enums to store a ton of info about things in the world. The default inspector for an enum shows a drop down box with a single value, so if you have more than one flag set in the enum it shows up as an empty box.

    This makes it useless when it comes to debugging what flags are set on an entity, I'd prefer some sort of list display where I can see anything that is 1.

    Has anyone had a play with this before? Is it even possible without forking the Entities package?
     
    Last edited: Nov 2, 2019
    Timboc likes this.
  2. SubPixelPerfect

    SubPixelPerfect

    Joined:
    Oct 14, 2015
    Posts:
    224
    yes, right now the only way to do is to fork Unity.Entities.Editor

    take a look at
    Unity.Entities.Editor/EntityInspector/EntityIMGUIVisitor
    and
    Unity.Entities.Editor/EntityInspector/Adapters/IMGUIPrimitivesAdapter