This commit is contained in:
陈思海 2025-07-29 17:34:54 +08:00
parent b7bbd9f6c6
commit 2842e19006

View File

@ -113,11 +113,25 @@ public class UXButton : UIBehaviour, IButton,
#region Unity Lifecycle #region Unity Lifecycle
protected override void Awake()
{
base.Awake();
Initlize();
}
#if UNITY_EDITOR #if UNITY_EDITOR
protected override void OnValidate() protected override void OnValidate()
{ {
base.OnValidate(); base.OnValidate();
if (!Application.isPlaying) if (!Application.isPlaying)
{
Initlize();
}
}
#endif // if UNITY_EDITOR
protected void Initlize()
{ {
_boardEvent = true; _boardEvent = true;
_waitTimeFadeDuration = new WaitForSeconds( _waitTimeFadeDuration = new WaitForSeconds(
@ -134,10 +148,6 @@ public class UXButton : UIBehaviour, IButton,
UpdateVisualState(m_SelectionState, true); UpdateVisualState(m_SelectionState, true);
} }
}
#endif // if UNITY_EDITOR
protected override void OnDestroy() protected override void OnDestroy()
{ {