37 lines
1.4 KiB
C#
37 lines
1.4 KiB
C#
using UnityEditor;
|
|
using UnityEditor.UI;
|
|
using UnityEngine.UIElements;
|
|
|
|
namespace NEG.UI.UnityUi.Editor
|
|
{
|
|
[CustomEditor(typeof(Buttons.CustomNavigationButton), true)]
|
|
public class CustomNavigationButtonEditor : ButtonEditor
|
|
{
|
|
private SerializedProperty upOverrideProperty;
|
|
private SerializedProperty downOverrideProperty;
|
|
private SerializedProperty leftOverrideProperty;
|
|
private SerializedProperty rightOverrideProperty;
|
|
|
|
protected override void OnEnable()
|
|
{
|
|
base.OnEnable();
|
|
upOverrideProperty = serializedObject.FindProperty("upOverride");
|
|
downOverrideProperty = serializedObject.FindProperty("downOverride");
|
|
leftOverrideProperty = serializedObject.FindProperty("leftOverride");
|
|
rightOverrideProperty = serializedObject.FindProperty("rightOverride");
|
|
}
|
|
|
|
public override void OnInspectorGUI()
|
|
{
|
|
base.OnInspectorGUI();
|
|
EditorGUILayout.Space();
|
|
|
|
serializedObject.Update();
|
|
EditorGUILayout.PropertyField(upOverrideProperty);
|
|
EditorGUILayout.PropertyField(downOverrideProperty);
|
|
EditorGUILayout.PropertyField(leftOverrideProperty);
|
|
EditorGUILayout.PropertyField(rightOverrideProperty);
|
|
serializedObject.ApplyModifiedProperties();
|
|
}
|
|
}
|
|
} |