Search Unity

EditorGUI.PropertyField does not honor PropertyDrawer.CreatePropertyGUI

Discussion in 'UI Toolkit' started by sient, Oct 21, 2019.

  1. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    I have an editor which overrides CreateInspectorGUI() so that the root inspector is using UIElements, which means that I can use PropertyDrawer types that also use UIElements.

    However, if I have a PropertyDrawer using IMGUI that embeds another PropertyDrawer using UIElements, the UIElements logic is not used.

    Code (CSharp):
    1. Inspector (UIElements)
    2.   PropertyDrawer (IMGUI)
    3.     PropertyDrawer (UIElements) -- doesn't work
    Is there a plan to enable this workflow? If not, it seems like switching to UIElements will be a significantly large amount of work since a bunch of IMGUI drawers will need rewriting.
     
  2. sebastiend-unity

    sebastiend-unity

    Unity Technologies

    Joined:
    Nov 9, 2015
    Posts:
    184
    Hi,

    As mentioned, IMGUI cannot hold UIElements-based UI. UIElements PropertyDrawers are in the plans, but that would still mean a bit of code refactoring/rewriting on your end (the PropertyDrawer part).