Search Unity

Suggestion for new Inspector / Editor Window UI

Discussion in 'General Discussion' started by jjxtra, Mar 12, 2019.

  1. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    Writing inspectors and editor UI is kind of painful right now. It requires hard-coding the entire user interface in a C# file, and recompiling the script to change any part of the UI. The Unity GUI APIs while useful, are showing their age and are not super user friendly. It's a slow iterative process to make custom UI in the editor right now.

    There are two things I would love to see in Unity:

    1] Reduce the need for custom inspector and editor UI by making additional attributes that can be applied to script or scriptable object fields. These could create buttons, labels or other custom controls just by configuring the attribute, eliminating the need for a custom editor script. These attributes would render the UI element right above the field they are on, or for a field marked [HideInInspector] right where that field would have gone.

    Use cases: buttons to perform actions, rendering logos or informational text, hyperlinks to online documentation, etc.

    2] It would be very cool to use a scene for an editor window or inspector editor. The concept of a scene in Unity fits well with an inspector editor or editor window. The scene would be required to have a main camera. The inspector window or editor window would be the viewport for the camera. The scene itself would be the editor for the inspector or editor window. Unity UI with canvas, 3D elements or other techniques could be used to render the user interface for whatever editing experience was needed.

    There would need to be a way to tell Unity to use a specific scene for an editor window or custom inspector, along with a way to pass model information to the scene about what object was being edited for the inspector, but this is mostly a plumbing problem, shouldn't be too hard.

    Thanks for reading, apologies if someone has already suggested this.
     
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,157
    Aren't editor extensions one of the primary use case for the upcoming UIElements stuff?
     
  3. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    Looks interesting. I hope they have a design time view. But having a scene be the editor would still open up a lot of interesting possibilities.
     
  4. AlexandreT-unity

    AlexandreT-unity

    Unity Technologies

    Joined:
    Feb 1, 2018
    Posts:
    377
    Hi Murgilod,

    Thanks for your suggestions. Be assured that we fully understand your concerns with IMGUI. Starting with 2019.1, UIElements becomes be the way to go for editor UI. This video should give you a good overview:


    As we work on bringing in-game support, some kind of interaction with the scene will be inevitable, but I can't specify details yet as we are still iterating on this. FYI most UIElements-related threads are in this section of the forum:
    https://forum.unity.com/forums/ui-systems-previews.178/
     
    PiezPiedPy likes this.
  5. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,464
    Thank you for sharing. I will visit that forum.