修复 CommonButton 导航功能失效的问题并重新绑定 UI 事件引用
This commit is contained in:
@@ -10,7 +10,6 @@ namespace SepCore.Editor
|
||||
{
|
||||
private SerializedProperty _background;
|
||||
private SerializedProperty _onPointerEnterAction;
|
||||
private SerializedProperty _onClickAction;
|
||||
private SerializedProperty _onPointerExitAction;
|
||||
|
||||
protected override void OnEnable()
|
||||
@@ -18,7 +17,6 @@ namespace SepCore.Editor
|
||||
base.OnEnable();
|
||||
_background = serializedObject.FindProperty("_background");
|
||||
_onPointerEnterAction = serializedObject.FindProperty("_onPointerEnterAction");
|
||||
_onClickAction = serializedObject.FindProperty("_onClickAction");
|
||||
_onPointerExitAction = serializedObject.FindProperty("_onPointerExitAction");
|
||||
}
|
||||
|
||||
@@ -31,7 +29,6 @@ namespace SepCore.Editor
|
||||
EditorGUILayout.LabelField("Common Button", EditorStyles.boldLabel);
|
||||
EditorGUILayout.PropertyField(_background);
|
||||
EditorGUILayout.PropertyField(_onPointerEnterAction);
|
||||
EditorGUILayout.PropertyField(_onClickAction);
|
||||
EditorGUILayout.PropertyField(_onPointerExitAction);
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
@@ -13,8 +13,6 @@ namespace SepCore.UI
|
||||
|
||||
[SerializeField] private UnityEvent _onPointerEnterAction = new();
|
||||
|
||||
[SerializeField] private UnityEvent _onClickAction = new();
|
||||
|
||||
[SerializeField] private UnityEvent _onPointerExitAction = new();
|
||||
|
||||
protected override void Awake()
|
||||
@@ -25,11 +23,13 @@ namespace SepCore.UI
|
||||
|
||||
protected override void OnEnable()
|
||||
{
|
||||
base.OnEnable();
|
||||
_background.color = _originalBackgroundColor;
|
||||
}
|
||||
|
||||
protected override void OnDisable()
|
||||
{
|
||||
base.OnDisable();
|
||||
_background.color = new Color(0.3f, 0.3f, 0.3f, 0.3f);
|
||||
}
|
||||
|
||||
@@ -43,13 +43,6 @@ namespace SepCore.UI
|
||||
EnterHoverState();
|
||||
}
|
||||
|
||||
public override void OnPointerDown(PointerEventData eventData)
|
||||
{
|
||||
base.OnPointerDown(eventData);
|
||||
|
||||
_onClickAction?.Invoke();
|
||||
}
|
||||
|
||||
public override void OnPointerExit(PointerEventData eventData)
|
||||
{
|
||||
if (eventData.button != PointerEventData.InputButton.Left)
|
||||
|
||||
Reference in New Issue
Block a user