using System;
|
using UnityEngine;
|
using UnityEngine.UI;
|
using System.Collections;
|
|
namespace vnxbqy.UI
|
{
|
|
public class ButtonClickInterval : MonoBehaviour
|
{
|
[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;
|
}
|
}
|
}
|