Do we need our hierarchy to be colorful ?

yes

no

This is a problem. I cant be the only one. after extensive development in a single project, my eyes are in a disarray with the hierarchy. Projects tend to get big fast with many many objects in the hierarchy. Black and white will no longer be acceptable to me. As a developer I cant waste time attempting to find 1 object out of 300 within a black and white format, and searching is not good enough. I'm simply suggesting to add colors to the hierarchy please. Its not that hard and the community will love it. Also adding a (Quick function) to change any label within the entire unity interface would be great. If unity cares about its users and cares about bigger projects being released by people then this is going to be necessary for extreme developers. I hope this message finds the person who can make change.

This is a problem. I cant be the only one. after extensive development in a single project, my eyes are in a disarray with the hierarchy. Projects tend to get big fast with many many objects in the hierarchy. Black and white will no longer be acceptable to me. As a developer I cant waste time attempting to find 1 object out of 300 within a black and white format, and searching is not good enough. I'm simply suggesting to add colors to the hierarchy please. Its not that hard and the community will love it. Also adding a (Quick function) to change any label within the entire unity interface would be great. If unity cares about its users and cares about bigger projects being released by people then this is going to be necessary for extreme developers. I hope this message finds the person who can make change.

Thanks You

Click to expand...

Check the assetstore, I'm pretty sure there is an asset that does most of what you want.

On top of that, splitting things like this actually helped me quite a bit and it makes me feel fancy. Got the idea from a #UnityTips tweet but I forgot the author's name. So, sorry whoever came up with this first!

Had an interesting time learning how to use the EditorApplication.hierarchyWindowItemOnGUI() delegate to manipulate the hierarchy visuals. I came up with a working concept that adds colored boxes to the left of the items list in the hierarchy.

Note there is some bug that causes the rootObjs array to contain extra root objects each time the editor reloads a script. So any time a script is saved and the editor reloads it, then the rootObjs array will contain some new (additional) element. This does not appear to cause any significant issue other than the array possibly growing large. I am not sure exactly why it is happening though whenever the scene is (re)loaded, or when the game starts/stops that array will once again be set to the correct and expected values, so it only appears to be a minor memory leak in the editor.

I was hoping someone out there might look over this line and possibly explain why extra root objects get added:

Code (csharp):

//This line doesn't always generate the expected results after reloading (any) script in the editor.

Lastly, you may notice there are two color selectors (fontColor and backgroundColor) and a boolean for highlighting when selected.However only the backgroundColor selector works. I left the other options for future improvements or if someone else can figure out how to make them apply to the hierarchy items.

[UPDATE]
I added a line to hierarchyWindowOnGUI which helps reset the index "i" and prevents the markers from "running away" and seems to have made the example much more reliable.

Code (csharp):

if(g ==null){//The first root "scene" hierarchy object.

i =0; // Reset index because "scene" is the first root element. <<< THIS WAS ADDED

return; // Return because there is no need to add marker to this unique element.

Moderator

My tool I very creatively call "Highlighter". It highlights objects in the hierarchy and project as well with a few options. I built it to be very lightweight and easy to disable/enable and uses internal assets. I opted to store everything in a scriptable object vs. editor prefs because I wanted the settings to follow the project regardless of the machine I am on and be unique to the project and not the editor.

It's basically 2 scripts, the editor one, and the SO. When it starts up if it can't find a Settings Asset, it will create one. There is a menu item (and key command) that basically selects the Scriptable object, which has a custom inspector on it. All edits are by modifying the Settings Assets. An earlier version I made used icons and had a few other options like regular expressions, but I kept trimming it down to the stuff I actually use and doesn't impact performance.
bigger image: