Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
UIDropdown Class Reference
Inheritance diagram for UIDropdown:
DropdownRecipe

Public Member Functions

override void OnCancel (BaseEventData eventData)
 
void SetList< TValue > (string name, IList< TValue > list, Func< TValue, int, string > getName, Action< int, TValue > onChange, bool notify=true)
 
void SetList< TValue > (int _index, IList< TValue > list, Func< TValue, int, string > getName, Action< int, TValue > onChange, bool notify=true)
 
void Next ()
 
void Prev ()
 

Public Attributes

UIButton bl
 

Static Public Attributes

static UIDropdown activeInstance
 

Protected Member Functions

override void OnEnable ()
 
override GameObject CreateBlocker (Canvas rootCanvas)
 
override void DestroyBlocker (GameObject blocker)
 

Private Member Functions

void Update ()
 

Detailed Description

Definition at line 7 of file UIDropdown.cs.

Member Function Documentation

◆ CreateBlocker()

override GameObject UIDropdown.CreateBlocker ( Canvas  rootCanvas)
inlineprotected

Definition at line 32 of file UIDropdown.cs.

33 {
34 activeInstance = this;
35 return base.CreateBlocker(rootCanvas);
36 }
static UIDropdown activeInstance
Definition: UIDropdown.cs:12
override GameObject CreateBlocker(Canvas rootCanvas)
Definition: UIDropdown.cs:32

References activeInstance, and CreateBlocker().

Referenced by CreateBlocker().

◆ DestroyBlocker()

override void UIDropdown.DestroyBlocker ( GameObject  blocker)
inlineprotected

Definition at line 38 of file UIDropdown.cs.

39 {
40 activeInstance = null;
41 if ((bool)bl)
42 {
43 UnityEngine.Object.Destroy(bl.gameObject);
44 bl = null;
45 }
46 base.DestroyBlocker(blocker);
47 }
UIButton bl
Definition: UIDropdown.cs:10

References activeInstance, and bl.

◆ Next()

void UIDropdown.Next ( )
inline

Definition at line 89 of file UIDropdown.cs.

90 {
91 if (base.value < base.options.Count - 1)
92 {
93 base.value++;
94 }
95 }

Referenced by Scene.OnUpdate().

◆ OnCancel()

override void UIDropdown.OnCancel ( BaseEventData  eventData)
inline

Definition at line 14 of file UIDropdown.cs.

15 {
16 }

◆ OnEnable()

override void UIDropdown.OnEnable ( )
inlineprotected

Definition at line 26 of file UIDropdown.cs.

27 {
28 base.OnEnable();
29 base.template.GetComponentInChildren<ScrollRect>().scrollSensitivity = UIScrollView.sensitivity;
30 }
static float sensitivity
Definition: UIScrollView.cs:7

References UIScrollView.sensitivity.

◆ Prev()

void UIDropdown.Prev ( )
inline

Definition at line 97 of file UIDropdown.cs.

98 {
99 if (base.value > 0)
100 {
101 base.value--;
102 }
103 }

Referenced by Scene.OnUpdate().

◆ SetList< TValue >() [1/2]

void UIDropdown.SetList< TValue > ( int  _index,
IList< TValue >  list,
Func< TValue, int, string >  getName,
Action< int, TValue >  onChange,
bool  notify = true 
)
inline

Definition at line 63 of file UIDropdown.cs.

64 {
65 base.options.Clear();
66 for (int i = 0; i < list.Count; i++)
67 {
68 base.options.Add(new OptionData
69 {
70 text = getName(list[i], i)
71 });
72 }
73 base.onValueChanged.RemoveAllListeners();
74 base.onValueChanged.AddListener(delegate(int a)
75 {
76 onChange(a, list[a]);
77 });
78 if (notify)
79 {
80 base.value = _index;
81 }
82 else
83 {
84 SetValueWithoutNotify(_index);
85 }
86 RefreshShownValue();
87 }

◆ SetList< TValue >() [2/2]

void UIDropdown.SetList< TValue > ( string  name,
IList< TValue >  list,
Func< TValue, int, string >  getName,
Action< int, TValue >  onChange,
bool  notify = true 
)
inline

Definition at line 49 of file UIDropdown.cs.

50 {
51 int index = 0;
52 for (int i = 0; i < list.Count; i++)
53 {
54 if (getName(list[i], i) == name)
55 {
56 index = i;
57 break;
58 }
59 }
60 SetList(index, list, getName, onChange, notify);
61 }

◆ Update()

void UIDropdown.Update ( )
inlineprivate

Definition at line 18 of file UIDropdown.cs.

19 {
20 if (activeInstance == this && Input.GetMouseButtonDown(1))
21 {
22 Hide();
23 }
24 }
Definition: Hide.cs:4

References activeInstance.

Member Data Documentation

◆ activeInstance

UIDropdown UIDropdown.activeInstance
static

◆ bl

UIButton UIDropdown.bl

Definition at line 10 of file UIDropdown.cs.

Referenced by DestroyBlocker().


The documentation for this class was generated from the following file: