This commit is contained in:
陈思海 2025-08-05 11:12:42 +08:00
parent b22e44a0e3
commit 3e557e4235

View File

@ -62,7 +62,6 @@ public class UXButton : UIBehaviour, IButton,
private Animator _animator;
private WaitForSeconds _waitTimeFadeDuration;
private Coroutine _resetRoutine;
private bool _boardEvent;
private readonly Dictionary<string, int> _animTriggerIDs = new();
private readonly Dictionary<string, int> _animResetTriggerIDs = new();
@ -132,7 +131,6 @@ public class UXButton : UIBehaviour, IButton,
protected void Initlize()
{
_boardEvent = true;
_waitTimeFadeDuration = new WaitForSeconds(
Mathf.Max(0.01f, m_TransitionData.colors.fadeDuration));
_animTriggerIDs.Clear();
@ -239,11 +237,16 @@ public class UXButton : UIBehaviour, IButton,
#region Public Methods
public void SetSelect(bool state, bool boardEvent = false)
public bool Selected
{
if (m_Mode != ButtonModeType.Toggle) return;
_boardEvent = boardEvent;
IsSelected = state;
get => IsSelected;
set
{
if (m_Mode == ButtonModeType.Toggle)
{
ProcessClick();
}
}
}
#endregion
@ -259,13 +262,6 @@ public class UXButton : UIBehaviour, IButton,
private void ProcessClick()
{
if (!_boardEvent)
{
_boardEvent = true;
return;
}
_boardEvent = true;
if (m_Mode == ButtonModeType.Normal)
{
UISystemProfilerApi.AddMarker("Button.onClick", this);