With the new version of Unity3D removing the default Alphanumeric sorting from the scene hierarchy (now sorts by transform), some of you folks have been wanting to get back previous functionality of sorting GameObjects in the scene hierarchy. This is understood. I prefer to sort alphabetically like normal human beings as it allows me to quickly scan the hierarchy for a specific object by name, instead of transform position.
Here’s what the Hierarchy looks like without sorting with some random GameObjects from our SHMUP Infinite Cosmos thrown in:
That’s just messed up. I like to see better sorting before my brain explodes. We can do this with a simple script we make in C# that gets thrown into a folder named “Editor” inside of the Assets folder. This folder is strictly for extending Unity Editor functionality and does not get included in builds. Here’s what the script looks like:
Save the script as $AlphaNumeric.cs, plop that into a folder name “Editor” and you can now select Alphanumeric sorting from the Hierarchy drop-down options:
Don’t worry about writing a new script using the above, feel free to download it:
Click to download