おそらく既出でしょうけど作ってみました!
Editor フォルダに下記スクリプトをいれる
MyMeshRendererInspector.cs
using UnityEngine;
using UnityEditor;
using System.Linq;
[CustomEditor(typeof(MeshRenderer))]
public class MyMeshRendererInspector : Editor
{
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.BeginHorizontal();
// sorting order
SerializedProperty sortOrderProperty = serializedObject.FindProperty("m_SortingOrder");
sortOrderProperty.intValue = EditorGUILayout.IntField("Sort Order", sortOrderProperty.intValue);
// sorting layer
SerializedProperty layerIDProperty = serializedObject.FindProperty("m_SortingLayerID");
var index = System.Array.FindIndex(SortingLayer.layers, layer => layer.id == layerIDProperty.intValue);
index = EditorGUILayout.Popup(index, (from layer in SortingLayer.layers select layer.name).ToArray());
layerIDProperty.intValue = SortingLayer.layers[index].id;
EditorGUILayout.EndHorizontal();
serializedObject.ApplyModifiedProperties();
base.OnInspectorGUI();
}
}
Sorting Layer と Order in Layer が表示されるようになります。
何か問題ありましたら教えてください!