I’ve developed endless amounts of editor extensions and while Unity’s felt flexible since the start, I’ve always run into the same painful limitations. UIToolkit’s stateful nature has for years allowed me to perform some hacks I’ve not had the luxury of performing with IMGUI, but it’s not been a particular boon to what I’d like to be doing: improving upon basic fields and making these improvements coexist with others.
Last I asked there was an indication that something similar to nesting property drawers was being considered. This would allow basic things—like a ReadOnly drawer—or more complex things—like a SerializeReference drawer—to combine with any other drawer without hacks.
As a related but very specific aside:
I’ve just been adding UITK support to my SerializeReference decorator, and while I’m glad that I’m not IL weaving the editor DLL as I have with the IMGUI version (to support nested property drawers), I am still performing some very full on and tedious to manage tricks!
I’m using decorator drawers because you can have multiple on a single property. I use events to hack around and find the PropertyField, and use reflection to get the SerializedProperty. Then seeing as decorators aren’t drawn on collection elements, I also have to turn those off, and inject my own fake decorators into the ListView’s elements. I have to jump through a ton of hoops to maintain these elements and events as UITK loves to overwrite it all without firing any relevant change callbacks. Then, when I’m done with it all I’m always left with a buggy mess, presumably as there’s no built-in UI for them this leads to very little test coverage!
Here’s an in-progress peek at that nightmare. And here’s a video of me just trying to use the thing and experiencing how busted property fields just appear to be with this setup.
Once I’m slightly further along someone’s going to be getting a bug report with like 3-5 UITK SerializeReference-related bugs in it, so look forward to that.
Anyway, will drawers become more flexible any time soon?
Are there plans for a SerializeReference type picker?
Will someone please add zooming (and 1x zoom) to the texture preview window? You can steal my old implementation if you want.