Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
UIScrollView.cs
Go to the documentation of this file.
1using UnityEngine;
2using UnityEngine.EventSystems;
3using UnityEngine.UI;
4
5public class UIScrollView : ScrollRect
6{
7 public static float sensitivity;
8
9 public UIItem header;
10
11 public bool enableHeader;
12
13 public bool disableDrag;
14
15 public float sensitivityMulti = 1f;
16
17 private float lastSens;
18
19 protected override void Awake()
20 {
21 base.Awake();
22 base.inertia = true;
23 base.decelerationRate = 0.02f;
24 Window componentInParent = GetComponentInParent<Window>();
25 if ((bool)componentInParent && (bool)componentInParent.rectStats && componentInParent.rectStats.gameObject.activeSelf)
26 {
27 RectTransform rectTransform = base.verticalScrollbar.Rect();
28 rectTransform.sizeDelta = new Vector2(rectTransform.sizeDelta.x, rectTransform.sizeDelta.y + componentInParent.rectStats.GetComponent<LayoutElement>().minHeight);
29 }
30 }
31
32 protected override void LateUpdate()
33 {
34 base.LateUpdate();
35 if (base.scrollSensitivity != sensitivity * sensitivityMulti)
36 {
37 base.scrollSensitivity = sensitivity * sensitivityMulti;
38 }
39 }
40
41 public void Refresh()
42 {
43 UpdateBounds();
44 base.CalculateLayoutInputHorizontal();
45 base.CalculateLayoutInputVertical();
46 OnRectTransformDimensionsChange();
47 base.SetLayoutVertical();
48 base.LateUpdate();
49 }
50
51 public override void OnBeginDrag(PointerEventData eventData)
52 {
53 if (!disableDrag)
54 {
55 base.OnBeginDrag(eventData);
56 }
57 }
58
59 public override void OnDrag(PointerEventData eventData)
60 {
61 if (!disableDrag)
62 {
63 base.OnDrag(eventData);
64 }
65 }
66
67 public override void OnEndDrag(PointerEventData eventData)
68 {
69 if (!disableDrag)
70 {
71 base.OnEndDrag(eventData);
72 }
73 }
74}
Definition: UIItem.cs:5
bool enableHeader
Definition: UIScrollView.cs:11
float lastSens
Definition: UIScrollView.cs:17
UIItem header
Definition: UIScrollView.cs:9
override void OnDrag(PointerEventData eventData)
Definition: UIScrollView.cs:59
void Refresh()
Definition: UIScrollView.cs:41
override void LateUpdate()
Definition: UIScrollView.cs:32
override void Awake()
Definition: UIScrollView.cs:19
bool disableDrag
Definition: UIScrollView.cs:13
float sensitivityMulti
Definition: UIScrollView.cs:15
override void OnEndDrag(PointerEventData eventData)
Definition: UIScrollView.cs:67
static float sensitivity
Definition: UIScrollView.cs:7
override void OnBeginDrag(PointerEventData eventData)
Definition: UIScrollView.cs:51
Definition: Window.cs:13
RectTransform rectStats
Definition: Window.cs:648