From 06da72770c641fabf980816ed466a2280dac2be7 Mon Sep 17 00:00:00 2001 From: yyl <yyl> Date: 星期二, 05 八月 2025 19:25:14 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts --- Main/Component/UI/Common/ButtonClickInterval.cs | 40 ++++++++++++++++++++-------------------- 1 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Main/Component/UI/Common/ButtonClickInterval.cs b/Main/Component/UI/Common/ButtonClickInterval.cs index f4eb65a..4b44d99 100644 --- a/Main/Component/UI/Common/ButtonClickInterval.cs +++ b/Main/Component/UI/Common/ButtonClickInterval.cs @@ -4,25 +4,25 @@ using System.Collections; - public class ButtonClickInterval : MonoBehaviour +public class ButtonClickInterval : MonoBehaviour +{ + [SerializeField] float interval = 1f; + [SerializeField] Button targetBtn; + + private void Awake() { - [SerializeField] float interval = 1f; - [SerializeField] Button targetBtn; - - private void Awake() - { - targetBtn.AddListener(OnClick); - } - - private void OnClick() - { - targetBtn.enabled = false; - StartCoroutine(DelayClick()); - } - - IEnumerator DelayClick() - { - yield return new WaitForSeconds(interval); - targetBtn.enabled = true; - } + targetBtn.AddListener(OnClick); } + + private void OnClick() + { + targetBtn.enabled = false; + StartCoroutine(DelayClick()); + } + + IEnumerator DelayClick() + { + yield return new WaitForSeconds(interval); + targetBtn.enabled = true; + } +} -- Gitblit v1.8.0