Search Unity

Unity Editor GUI Styling Convention?

Discussion in 'Immediate Mode GUI (IMGUI)' started by JackTheFoxOtter, May 9, 2018.

  1. JackTheFoxOtter

    JackTheFoxOtter

    Joined:
    Sep 24, 2016
    Posts:
    1
    Hi everyone.
    I've very recently started working with custom editor windows and editor extensions in general.
    I want to make my editor extension's GUI resemble Unitys as closely as possible to make it fit in seamlessly and provide a (mostly) streamlined workflow when using it.
    That said, I am trying to style the UI the same way the editor is styled.
    For the most parts I've been googling a lot, reading forums about what classes and styles to use where, but I often result in having to experiment around with it myself.
    I am still searching for a few elements (like the lighter background on the first item in the hierachy) and am having trouble finding them, mainly because I do not now how these things are named and therefore can't find the corresponding documentations or forum questions. These are all small examples but it made me wonder, is there no place where all editor-GUI elements are listed with screenshots and links to the corresponding documentation? In the end, re-creating these small things wouldn't be a problem, but I would rather like to use the proper classes and styles, simply because of the fact that they are already there somewhere.
    Is there something you can suggest?
    Thanks in Advance.
     
  2. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    826
  3. BinaryCats

    BinaryCats

    Joined:
    Feb 8, 2016
    Posts:
    317
    The above thing is useful, however, when I want to mimic how unity looks I usually have more success looking through https://github.com/Unity-Technologies/UnityCsReference , there is quite a bit off guess work involved, but usually doesn't take more than 5 mins down to find the style I want
     
  4. Madgvox

    Madgvox

    Joined:
    Apr 13, 2014
    Posts:
    1,317
    You will likely end up having to duplicate some of the styles regardless, as much of the unity editor is locked behind internal classes and methods. I've found the
    EditorStyles
    class to be particularly useful as a quick way to style most common editor controls.

    I also echo BinaryCats that the unity source is your best friend when it comes to creating custom editors. There is a lot of info that simply does not exist anywhere else.