Can't use HashSet<Interface>

Issue #250 resolved
Maurizio Margiotta created an issue

I need to add into an HashSet some instances of classes inheriting from an interface.

Odin says "There is no custom drawer defined for type 'HashSet<IOptimizationSettings>' and the type has no members to draw.

I'm converting my code base from FullInspector to Odin, and this is now quite stopping me to proceed.

Any hint? Unity 2017.2.0f3 - OSX 10.12.6 - Odin 1.0.5.3

Comments (7)

  1. Bjarke Elias
    • changed status to open

    Hi Maurizio,

    HashSets are unfortunately not yet supported in Odin, they are Serialized just fine, but we don't have a drawer for it yet. We're actively working on a major internal change of the Odin property system, specifically to make it easier for us and others, to add support for types such as HashSet, Stack, Queue, LinkedLists etc...

    Until then I'm afraid your best option is to display the HashSet through a list.

  2. Maurizio Margiotta reporter

    Yes is what I did, but then I have to instantiate and populate the hash using the serialized list. It's fine because is only on startup. Otherwise I'll be looking forward for the new update. Thanks!

  3. Radu Septimiu Cristea

    Is there an ETA for this feature?

    We use hashsets extensively and this is a non-starter for our migration to Odin.

  4. Tor Esa Vestergaard

    To give you an update, we now have a working and apparently stable prototype of the new property system, post-rework. It's not ready for release yet, but we're beginning to put it through its paces. We haven't added support for hashsets to it, but it is now rather trivial to do, compared to how difficult it would have been in the old system. So while hashsets are not there yet, progress is going very well on the feature that is needed for hashsets to be added.

  5. Log in to comment