yyl
2025-08-25 cec8b67d82c2c2c1662d55c818c4a46bcc0487db
Main/Component/UI/Common/FakeButton2.cs
@@ -1,14 +1,13 @@
//--------------------------------------------------------
//    [Author]:           第二世界
//    [Author]:           玩个游戏
//    [  Date ]:           Saturday, November 25, 2017
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.Events;
using System;
namespace vnxbqy.UI
{
    [RequireComponent(typeof(RectTransform))]
    public class FakeButton2 : MonoBehaviour
    {
@@ -17,16 +16,16 @@
        public RectTransform rectTransform { get { return m_RectTransform ?? (m_RectTransform = this.transform as RectTransform); } }
        float overTime = float.MaxValue;
        UIEvent m_OnClick = new UIEvent();
        Action m_OnClick;
        public void AddListener(UnityAction _callBack)
        public void AddListener(Action _callBack)
        {
            m_OnClick.AddListener(_callBack);
            m_OnClick += _callBack;
        }
        public void RemoveAllListeners()
        {
            m_OnClick.RemoveAllListeners();
            m_OnClick = null;
        }
        private void LateUpdate()
@@ -47,7 +46,7 @@
                {
                    if (Time.realtimeSinceStartup > overTime)
                    {
                        m_OnClick.Invoke();
                        m_OnClick?.Invoke();
                        overTime = float.MaxValue;
                    }
                }
@@ -55,8 +54,4 @@
        }
    }
}