31 lines
981 B
C#
31 lines
981 B
C#
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace AibisDream.SystemEditor
|
|
{
|
|
[CustomEditor(typeof(GridVisualizer))]
|
|
public class GridVisualizerEditor : Editor
|
|
{
|
|
private SerializedProperty sortingLayerProperty;
|
|
private SerializedProperty sortingOrderProperty;
|
|
|
|
private void OnEnable()
|
|
{
|
|
sortingLayerProperty = serializedObject.FindProperty("sortingLayer");
|
|
sortingOrderProperty = serializedObject.FindProperty("sortingOrder");
|
|
}
|
|
|
|
public override void OnInspectorGUI()
|
|
{
|
|
base.OnInspectorGUI();
|
|
|
|
serializedObject.Update();
|
|
|
|
EditorGUILayout.LabelField("层级设置", EditorStyles.boldLabel);
|
|
EditorKit.SortingLayerField(new GUIContent("目标层级"), sortingLayerProperty);
|
|
EditorGUILayout.PropertyField(sortingOrderProperty, new GUIContent("层级顺序"));
|
|
|
|
serializedObject.ApplyModifiedProperties();
|
|
}
|
|
}
|
|
} |