Car/Assets/StompyRobot/SRF/Scripts/UI/Editor/LongPressButtonEditor.cs

29 lines
751 B
C#
Raw Permalink Normal View History

2025-01-02 11:32:58 +08:00
using UnityEditor;
using UnityEditor.UI;
namespace SRF.UI.Editor
{
[CustomEditor(typeof (LongPressButton), true)]
[CanEditMultipleObjects]
public class LongPressButtonEditor : ButtonEditor
{
private SerializedProperty _onLongPressProperty;
protected override void OnEnable()
{
base.OnEnable();
_onLongPressProperty = serializedObject.FindProperty("_onLongPress");
}
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
EditorGUILayout.Space();
serializedObject.Update();
EditorGUILayout.PropertyField(_onLongPressProperty);
serializedObject.ApplyModifiedProperties();
}
}
}