I would like to know how to get a list of all sorting layers. I'm able to access the tags list and layers list by using the class UnityEditorInternal.InternalEditorUtility. But I can't find the sorting layers anywhere. Please advise.
This property is internal and we can't get sortingLayers. But... Code (csharp): Type internalEditorUtilityType = typeof(InternalEditorUtility); PropertyInfo sortingLayersProperty = internalEditorUtilityType.GetProperty("sortingLayerNames", BindingFlags.Static | BindingFlags.NonPublic); string[] sortingLayers = (string[])sortingLayersProperty.GetValue(null, new object[0]); foreach (string layer in sortingLayers) { Debug.Log(layer); }