Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  8. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Unity Editor GUI Styling Convention?

Discussion in 'Extensions & OnGUI' started by Uebertreiberman, May 9, 2018.

  1. Uebertreiberman

    Uebertreiberman

    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:
    498
  3. BinaryCats

    BinaryCats

    Joined:
    Feb 8, 2016
    Posts:
    126
    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:
    284
    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.