少年修仙传客户端代码仓库
Client_PangDeRong
2019-01-14 13d35f0b5daf77c786a2bc953ac39f4d81c80132
2862 【BUG】【1.5】 许愿池,快速点击刷新,出极品道具时会被刷新
2个文件已添加
43 ■■■■■ 已修改文件
UI/Common/ButtonClickInterval.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI/Common/ButtonClickInterval.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI/Common/ButtonClickInterval.cs
New file
@@ -0,0 +1,31 @@
using System;
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
namespace Snxxz.UI
{
    [XLua.Hotfix]
    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;
        }
    }
}
UI/Common/ButtonClickInterval.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 4761530da641c6b49ae3d21a397bea40
timeCreated: 1547433750
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant: