From af4b77e2c358f6bedea8fc141124b47858e8e192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=80=9D=E6=B5=B7?= <1464576565@qq.com> Date: Thu, 18 Sep 2025 14:34:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0UXButton=20Dsiable=E5=B1=9E?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runtime/UXComponent/UX/UXButton.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Runtime/UXComponent/UX/UXButton.cs b/Runtime/UXComponent/UX/UXButton.cs index 2a61122..656c825 100644 --- a/Runtime/UXComponent/UX/UXButton.cs +++ b/Runtime/UXComponent/UX/UXButton.cs @@ -258,6 +258,18 @@ public class UXButton : UIBehaviour, IButton, _resetRoutine = StartCoroutine(OnFinishSubmit()); } + public bool Disable + { + get => m_Interactable; + set + { + if (m_Interactable == value) return; + m_Interactable = value; + m_SelectionState = !m_Interactable ? SelectionState.Disabled : SelectionState.Normal; + UpdateVisualState(m_SelectionState, false); + } + } + #endregion #region Public Methods