2020.1.10 Inspectors and PropertyDrawers still use IMGUI by default

I’m not quite clear on the different usages between IMGUI and UIElements/UIToolkit inspectors. Are UIElements PropertyDrawers only drawn if the entire Editor is using the UIElements workflow?

When creating editor UI now, should we be including support for both? For example, when making PropertyDrawers, should we include both GUI creation methods? (OnGUI for IMGUI, and CreatePropertyGUI for UIElements)

UI Toolkit will eventually replace IMGUI. However, UI Toolkit doesn’t start from scratch and takes advantage of the Editor and PropertyDrawer classes used to display data in the Inspector.

So, Unity added a new overridable method called “OnCreatePropertyGUI” that signals the Editor/PropertyDrawer that this drawer should use UI Toolkit instead of IMGUI.

However, there’s a catch. If you use UI Toolkit, all parent drawers must use UI Toolkit. Otherwise it will prompt a message saying something like “GUI Not Implemented”

I don’t think you’re meant to use both UI Toolkit + IMGUI for each element. If you’re writing custom editors for components or scriptable objects, I’d stick to UI Toolkit. However, if you’re writing a custom property drawer that might be used on an arbitrary number of components and you don’t plan to create a custom editor for these, just stick to IMGUI.

I’m talking more about PropertyDrawers. Most custom Editors or EditorWindows can entirely function using one or the other, but PropertyDrawers are used throughout both. (EditorGUI.PropertyField in IMGUI, PropertyField in UIToolkit)

What I’ve found is that, in order to support all PropertyDrawer instances, you should support both IMGUI and UIElements UI creation. I was just wondering if this is standard expected functionality now. It kinda sucks because it’s double the work for tool devs, but it’s understandable.