From eb1efcaa9be0e2340fc49b38dab8df18e36526c9 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期五, 13 六月 2025 17:57:43 +0800
Subject: [PATCH] 117 【武将】武将系统 卡牌信息&Manager初始化前移

---
 Main/Component/UI/Common/FakeButton2.cs |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/Main/Component/UI/Common/FakeButton2.cs b/Main/Component/UI/Common/FakeButton2.cs
index 30aaa1a..68767a8 100644
--- a/Main/Component/UI/Common/FakeButton2.cs
+++ b/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 @@
         }
 
     }
-
-}
-
-
 

--
Gitblit v1.8.0