少年修仙传客户端代码仓库
hch
2025-06-12 204ef05a831c9484e2abc561d27ecbff7c797453
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Monday, July 31, 2017
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;
using UnityEngine.Events;
 
namespace vnxbqy.UI
{
 
    public class PointerDownUp : MonoBehaviour, IPointerDownHandler, IPointerUpHandler, IPointerClickHandler
    {
 
        [SerializeField]
        UIEvent m_OnPointerDown;
        public UIEvent onPointerDown { get { return m_OnPointerDown; } }
 
        [SerializeField]
        UIEvent m_OnPointerUp;
        public UIEvent onPointerUp { get { return m_OnPointerUp; } }
 
        [SerializeField]
        UIEvent m_OnPointerClick;
        public UIEvent onPointerClick {
            get {
                return m_OnPointerClick;
            }
        }
 
        public void OnPointerUp(PointerEventData eventData)
        {
            if (onPointerUp != null)
            {
                onPointerUp.Invoke();
            }
        }
 
        public void OnPointerDown(PointerEventData eventData)
        {
            if (onPointerDown != null)
            {
                onPointerDown.Invoke();
            }
        }
 
        public void OnPointerClick(PointerEventData eventData)
        {
            if (onPointerClick != null)
            {
                onPointerClick.Invoke();
            }
        }
 
        public void AddPointerDownListener(UnityAction _action)
        {
            if (onPointerDown != null)
            {
                onPointerDown.AddListener(_action);
            }
        }
 
        public void AddPointerUpListener(UnityAction _action)
        {
            if (onPointerUp != null)
            {
                onPointerUp.AddListener(_action);
            }
        }
 
        public void AddPointerClickListener(UnityAction _action)
        {
            if (onPointerClick != null)
            {
                onPointerClick.AddListener(_action);
            }
        }
 
        public void RemoveAllPointerDownListeners()
        {
            if (onPointerDown != null)
            {
                onPointerDown.RemoveAllListeners();
            }
        }
 
        public void RemoveAllPointerUpListeners()
        {
            if (onPointerUp != null)
            {
                onPointerUp.RemoveAllListeners();
            }
        }
 
        public void RemoveAllPointerClickListeners()
        {
            if (onPointerClick != null)
            {
                onPointerClick.RemoveAllListeners();
            }
        }
 
 
    }
 
}