Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

CreatePropertyGUI drawer no rendering in inspector: "No GUI implemented"

Discussion in 'UI Toolkit' started by Stacklucker, Nov 13, 2021.

  1. Stacklucker

    Stacklucker

    Joined:
    Jan 23, 2015
    Posts:
    82
    Could someone please tell me why the official property drawer example found in the https://docs.unity3d.com/ScriptReference/PropertyDrawer.html docs does not work?

    I copied the Ingredient, Recipe and IngredientDrawerUIE class in my project (the latter being inside an Editor folder) and the inspector says "No GUI implement". What is wrong here ?

    I've been working with UIElements in EditorWindows so far and didn't have these problems. Are normal inspectors of monobehaviours not supported???
     
  2. billykater

    billykater

    Joined:
    Mar 12, 2011
    Posts:
    327
    By default UIToolkit property drawers are only supported inside UIToolkit CustomEditors and the default inspector is still imgui. You can refer to this recent post and thread on how to enable UIToolkit property drawers.
    Seems with 2022.1 they will be finally changing the defaults but I haven't tested it yet.
     
    Frolky, marcospgp and Stacklucker like this.
  3. Stacklucker

    Stacklucker

    Joined:
    Jan 23, 2015
    Posts:
    82
    Thanks. This is ridiculous.
     
  4. felipemullen

    felipemullen

    Joined:
    Mar 4, 2017
    Posts:
    44
    Here to report 2022.1.0b14 is still showing "No GUI Implemented" by default. I assume this will be soon fixed because the official docs for that version still have `CreatePropertyGUI` as an example
     
    marcospgp likes this.
  5. felipemullen

    felipemullen

    Joined:
    Mar 4, 2017
    Posts:
    44
    I updated the other thread as well, but @Stacklucker in case you're searching for this functionality 6 months later, it's working in the alpha 2022.2.0a9, not in the 2022.1.0b13 beta though
     
    marcospgp and Stacklucker like this.
  6. marcospgp

    marcospgp

    Joined:
    Jun 11, 2018
    Posts:
    162
    I was not expecting to have to update to a cutting edge version in order to be able to follow the official docs for a property drawer using UI Toolkit o_O

    But now looking back at the docs, it seems there is a paragraph concerning this:

    upload_2022-9-21_21-34-13.png

    This is however not clear at all and so specific I could not identify it until I already knew the answer.
     
    Last edited: Sep 21, 2022
  7. hawaiian_lasagne

    hawaiian_lasagne

    Joined:
    May 15, 2013
    Posts:
    120
    What is a UIElements-based inspector? I thought it was InspectorElement but it looks like that still uses IMGUIContainer internally, as least according to the UIDebugger.
     
  8. marcospgp

    marcospgp

    Joined:
    Jun 11, 2018
    Posts:
    162
    Are you on the beta release branch?
     
  9. hawaiian_lasagne

    hawaiian_lasagne

    Joined:
    May 15, 2013
    Posts:
    120
    I'm on 2022.1.17f1
     
  10. marcospgp

    marcospgp

    Joined:
    Jun 11, 2018
    Posts:
    162
    Try updating to 2022.2.
     
  11. TheNullReference

    TheNullReference

    Joined:
    Nov 30, 2018
    Posts:
    222
    I've just run into this problem with a PropertyDrawer built in UIElements, which fails to render inside any custom editor that uses IMGUI.

    Does this means all UIElement property drawers are incompatible with IMGUI editors? That's a pretty big oversight that's going to cause people to stick with IMGUI.

    Code (csharp):
    1.        
    2. public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    3. {
    4.      // Need to somehow draw CreatePropertyGUI when this is called
    5. }
    6.  
     
  12. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,844
    That's been a known limitation since day one, I think. They are pretty fundamentally different. You can draw IMGUI inside of UI toolkit, but not the other way around.

    It's not impossible, however. The devs behind Odin somehow managed to get UI Toolkit working inside of IMGUI, but don't ask me how they did it.
     
    TheNullReference likes this.
  13. euden_one

    euden_one

    Joined:
    Apr 4, 2022
    Posts:
    32
    Once more blocked because of Unity new thinghy was half implemented. ‍:facepalm:

    Unity 2022.3 LTS cannot draw a property drawer without having to implement an inspector drawer for the script.

    Just stick to OnGUI() it is enough for most things and it's even simpler to read the code.