57 lines
2.6 KiB
C#
57 lines
2.6 KiB
C#
namespace AlicizaX.UI.Extension.Editor
|
|
{
|
|
using AlicizaX.UI.Extension;
|
|
using UnityEditor;
|
|
using UnityEditor.UI;
|
|
|
|
[CustomEditor(typeof(UIButtonSuper), true)]
|
|
[CanEditMultipleObjects]
|
|
public class UIButtonSuperEditor : ButtonEditor
|
|
{
|
|
private SerializedProperty m_ButtonUISounds;
|
|
private SerializedProperty m_CanClick;
|
|
private SerializedProperty m_CanDoubleClick;
|
|
private SerializedProperty m_DoubleClickIntervalTime;
|
|
private SerializedProperty onDoubleClick;
|
|
|
|
private SerializedProperty m_CanLongPress;
|
|
private SerializedProperty m_ResponseOnceByPress;
|
|
private SerializedProperty m_LongPressDurationTime;
|
|
private SerializedProperty onPress;
|
|
|
|
protected override void OnEnable()
|
|
{
|
|
base.OnEnable();
|
|
|
|
m_ButtonUISounds = serializedObject.FindProperty("m_ButtonUISounds");
|
|
m_CanClick = serializedObject.FindProperty("m_CanClick");
|
|
m_CanDoubleClick = serializedObject.FindProperty("m_CanDoubleClick");
|
|
m_DoubleClickIntervalTime = serializedObject.FindProperty("m_DoubleClickIntervalTime");
|
|
onDoubleClick = serializedObject.FindProperty("onDoubleClick");
|
|
|
|
m_CanLongPress = serializedObject.FindProperty("m_CanLongPress");
|
|
m_ResponseOnceByPress = serializedObject.FindProperty("m_ResponseOnceByPress");
|
|
m_LongPressDurationTime = serializedObject.FindProperty("m_LongPressDurationTime");
|
|
onPress = serializedObject.FindProperty("onPress");
|
|
}
|
|
|
|
public override void OnInspectorGUI()
|
|
{
|
|
base.OnInspectorGUI();
|
|
serializedObject.Update();
|
|
EditorGUILayout.PropertyField(m_ButtonUISounds); //显示我们创建的属性
|
|
EditorGUILayout.PropertyField(m_CanClick); //显示我们创建的属性
|
|
EditorGUILayout.Space(); //空行
|
|
EditorGUILayout.PropertyField(m_CanDoubleClick); //显示我们创建的属性
|
|
EditorGUILayout.PropertyField(m_DoubleClickIntervalTime); //显示我们创建的属性
|
|
EditorGUILayout.PropertyField(onDoubleClick); //显示我们创建的属性
|
|
EditorGUILayout.Space(); //空行
|
|
EditorGUILayout.PropertyField(m_CanLongPress); //显示我们创建的属性
|
|
EditorGUILayout.PropertyField(m_ResponseOnceByPress); //显示我们创建的属性
|
|
EditorGUILayout.PropertyField(m_LongPressDurationTime); //显示我们创建的属性
|
|
EditorGUILayout.PropertyField(onPress); //显示我们创建的属性
|
|
serializedObject.ApplyModifiedProperties();
|
|
}
|
|
}
|
|
}
|