yyl
2025-05-19 b118ece3db250a5a257b60713da92234d8d5a57a
Main/Component/UI/Common/FakeButton2.cs
@@ -6,9 +6,8 @@
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 @@
        }
    }
}