From 9e89e605d5429babb4b33df2e47ea86dff9d2ba7 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 20 十一月 2025 11:55:04 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
---
Main/Component/UI/Common/FakeButton.cs | 18 ++++++++----------
1 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/Main/Component/UI/Common/FakeButton.cs b/Main/Component/UI/Common/FakeButton.cs
index c328acd..e53a43c 100644
--- a/Main/Component/UI/Common/FakeButton.cs
+++ b/Main/Component/UI/Common/FakeButton.cs
@@ -1,30 +1,30 @@
锘�//--------------------------------------------------------
-// [Author]: 绗簩涓栫晫
+// [Author]: 鐜╀釜娓告垙
// [ Date ]: Saturday, November 25, 2017
//--------------------------------------------------------
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using System.Collections.Generic;
+using System;
-namespace vnxbqy.UI
-{
+
[RequireComponent(typeof(RectTransform))]
public class FakeButton : MonoBehaviour, IPointerClickHandler, IPointerDownHandler, IPointerUpHandler, IDragHandler
{
RectTransform m_RectTransform;
public RectTransform rectTransform { get { return m_RectTransform ?? (m_RectTransform = this.transform as RectTransform); } }
- UIEvent m_OnClick = new UIEvent();
+ Action m_OnClick;
- public void AddListener(UnityAction _callBack)
+ public void AddListener(Action action)
{
- m_OnClick.AddListener(_callBack);
+ m_OnClick += action;
}
public void RemoveAllListeners()
{
- m_OnClick.RemoveAllListeners();
+ m_OnClick = null;
}
public void OnPointerUp(PointerEventData eventData)
@@ -44,7 +44,7 @@
public void OnPointerClick(PointerEventData eventData)
{
- m_OnClick.Invoke();
+ m_OnClick?.Invoke();
PassEvent(eventData, ExecuteEvents.submitHandler);
PassEvent(eventData, ExecuteEvents.pointerClickHandler);
}
@@ -68,8 +68,6 @@
}
-
-}
--
Gitblit v1.8.0