-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathHoverComponentModule.cs
More file actions
59 lines (32 loc) · 1.44 KB
/
HoverComponentModule.cs
File metadata and controls
59 lines (32 loc) · 1.44 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
namespace UnityEngine.UI.Windows {
public class HoverComponentModule : ButtonComponentModule, UnityEngine.EventSystems.IPointerEnterHandler, UnityEngine.EventSystems.IPointerExitHandler {
[UnityEngine.UI.Windows.Utilities.RequiredReferenceAttribute]
public WindowComponent content;
public override void ValidateEditor() {
base.ValidateEditor();
if (this.content != null) {
this.content.hiddenByDefault = true;
this.content.AddEditorParametersRegistry(new EditorParametersRegistry(this) {
holdHiddenByDefault = true,
});
}
}
public override void OnInit() {
base.OnInit();
WindowSystem.onPointerUp += this.OnPointerUp;
}
public override void OnDeInit() {
WindowSystem.onPointerUp -= this.OnPointerUp;
base.OnDeInit();
}
private void OnPointerUp() {
if (this.content != null) this.content.Hide();
}
public void OnPointerEnter(UnityEngine.EventSystems.PointerEventData eventData) {
if (this.content != null) this.content.Show();
}
public void OnPointerExit(UnityEngine.EventSystems.PointerEventData eventData) {
if (this.content != null) this.content.Hide();
}
}
}