A Sorting Layer Debugger for Unity
While I was reading about 2D Sorting and Sorting Layers on Unity Manual I came up with the idea of creating a custom editor window to see which sorting layer the sprites on the scene are using.
In the video above you can see the Sorting Layer Debugger been used in the Unity 2D Platformer sample project
Setup
Just download the gist bellow to your Unity3D project and add it inside a Editor
folder.
Usage
You can open the debugger window through the menu Window / Sorting Layer Debugger
.
The debugger can be enabled in the edit or the play mode and it will list the Sorting Layers and the number of game objects using each layer. You can hide/show the game objects of each layer by clicking on its check box.
The name of Sorting Layer been used is showing in the top of each game object in the scene view.
Scene view with Sorting Layer Debugger enabled