forked from MattRix/UnityDecompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButton.cs
More file actions
71 lines (63 loc) · 1.47 KB
/
Button.cs
File metadata and controls
71 lines (63 loc) · 1.47 KB
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
using System;
using System.Collections;
using System.Diagnostics;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using UnityEngine.Serialization;
namespace UnityEngine.UI
{
[AddComponentMenu("UI/Button", 30)]
public class Button : Selectable, IPointerClickHandler, ISubmitHandler, IEventSystemHandler
{
[Serializable]
public class ButtonClickedEvent : UnityEvent
{
}
[FormerlySerializedAs("onClick"), SerializeField]
private Button.ButtonClickedEvent m_OnClick = new Button.ButtonClickedEvent();
public Button.ButtonClickedEvent onClick
{
get
{
return this.m_OnClick;
}
set
{
this.m_OnClick = value;
}
}
protected Button()
{
}
private void Press()
{
if (this.IsActive() && this.IsInteractable())
{
this.m_OnClick.Invoke();
}
}
public virtual void OnPointerClick(PointerEventData eventData)
{
if (eventData.button == PointerEventData.InputButton.Left)
{
this.Press();
}
}
public virtual void OnSubmit(BaseEventData eventData)
{
this.Press();
if (this.IsActive() && this.IsInteractable())
{
this.DoStateTransition(Selectable.SelectionState.Pressed, false);
base.StartCoroutine(this.OnFinishSubmit());
}
}
[DebuggerHidden]
private IEnumerator OnFinishSubmit()
{
Button.<OnFinishSubmit>c__Iterator0 <OnFinishSubmit>c__Iterator = new Button.<OnFinishSubmit>c__Iterator0();
<OnFinishSubmit>c__Iterator.$this = this;
return <OnFinishSubmit>c__Iterator;
}
}
}