Elin Decompiled Documentation EA 23.288 Nightly
Loading...
Searching...
No Matches
UIList.Callback< T1, T2 > Class Template Reference
Inheritance diagram for UIList.Callback< T1, T2 >:
UIList.ICallback

Public Member Functions

void SetList (UIList _list)
 
void CreateMold ()
 
Component GetMold ()
 
Component Instantiate (object obj, Transform parent)
 
void OnClick (object obj, Component button)
 
void OnList (SortMode mode)
 
void OnRedraw (object obj, Component c, int index)
 
int OnSort (object obj, SortMode mode)
 
void OnRefresh ()
 
void OnDragReorder (object obj, int a)
 
bool CanDragReorder (object obj)
 
Component GetComponent (Transform t)
 
Component GetComponent (Transform t)
 
void SetList (UIList list)
 
void CreateMold ()
 
Component Instantiate (object obj, Transform parent)
 
Component GetMold ()
 
void OnClick (object obj, Component button)
 
void OnRedraw (object obj, Component button, int index)
 
void OnList (SortMode mode)
 
int OnSort (object obj, SortMode mode)
 
void OnRefresh ()
 
void OnDragReorder (object obj, int a)
 
bool CanDragReorder (object obj)
 

Public Attributes

Action< T1, T2 > onInstantiate
 
Action< T1, T2 > onClick
 
Action< T1, T2, int > onRedraw
 
Action< SortModeonList
 
Func< T1, SortMode, int > onSort
 
Action onRefresh
 
T2 mold
 
UIList list
 
Action< T1, int > onDragReorder
 
Func< T1, bool > canDragReorder
 

Properties

bool useSort [get]
 
bool useOnClick [get]
 
- Properties inherited from UIList.ICallback
bool useSort [get]
 
bool useOnClick [get]
 

Detailed Description

Type Constraints
T2 :Component 

Definition at line 53 of file UIList.cs.

Member Function Documentation

◆ CanDragReorder()

bool UIList.Callback< T1, T2 >.CanDragReorder ( object  obj)
inline

Implements UIList.ICallback.

Definition at line 168 of file UIList.cs.

169 {
170 if (canDragReorder != null)
171 {
172 return canDragReorder((T1)obj);
173 }
174 return false;
175 }
Func< T1, bool > canDragReorder
Definition: UIList.cs:73

References UIList.Callback< T1, T2 >.canDragReorder.

◆ CreateMold()

void UIList.Callback< T1, T2 >.CreateMold ( )
inline

Implements UIList.ICallback.

Definition at line 84 of file UIList.cs.

85 {
86 if (!mold)
87 {
88 mold = list.GetMold<T2>();
89 }
90 }
UIList list
Definition: UIList.cs:69

References UIList.Callback< T1, T2 >.list, and UIList.Callback< T1, T2 >.mold.

◆ GetComponent()

Component UIList.Callback< T1, T2 >.GetComponent ( Transform  t)
inline

Implements UIList.ICallback.

Definition at line 177 of file UIList.cs.

178 {
179 return t.GetComponent<T2>();
180 }

◆ GetMold()

Component UIList.Callback< T1, T2 >.GetMold ( )
inline

Implements UIList.ICallback.

Definition at line 92 of file UIList.cs.

93 {
94 return mold;
95 }

References UIList.Callback< T1, T2 >.mold.

◆ Instantiate()

Component UIList.Callback< T1, T2 >.Instantiate ( object  obj,
Transform  parent 
)
inline

Implements UIList.ICallback.

Definition at line 97 of file UIList.cs.

98 {
99 T2 val = (list.usePool ? PoolManager.Spawn(mold) : UnityEngine.Object.Instantiate(mold));
100 val.SetActive(enable: true);
101 val.transform.SetParent(parent, worldPositionStays: false);
103 {
104 UIButton uIButton = (val as UIButton) ?? (val as UIItem)?.button1;
105 if ((bool)uIButton)
106 {
107 uIButton.instantClick = false;
108 }
109 }
110 if (onInstantiate != null)
111 {
112 onInstantiate((T1)obj, val);
113 }
114 if (onDragReorder != null)
115 {
116 UIListDragItem orCreate = val.GetOrCreate<UIListDragItem>();
117 orCreate.list = list;
118 orCreate.item = obj;
119 }
120 return val;
121 }
static Transform Spawn(string id, string path, Transform parent)
Definition: PoolManager.cs:86
Definition: UIItem.cs:5
Action< T1, T2 > onInstantiate
Definition: UIList.cs:55
Action< T1, int > onDragReorder
Definition: UIList.cs:71
bool disableInstaClick
Definition: UIList.cs:255
UIList parent
Definition: UIList.cs:293

References UIList.disableInstaClick, UIList.Callback< T1, T2 >.list, UIList.Callback< T1, T2 >.mold, UIList.Callback< T1, T2 >.onDragReorder, UIList.Callback< T1, T2 >.onInstantiate, UIList.parent, and PoolManager.Spawn().

◆ OnClick()

void UIList.Callback< T1, T2 >.OnClick ( object  obj,
Component  button 
)
inline

Implements UIList.ICallback.

Definition at line 123 of file UIList.cs.

124 {
125 if (onClick != null)
126 {
127 onClick((T1)obj, (T2)button);
128 }
129 }
Action< T1, T2 > onClick
Definition: UIList.cs:57

References UIList.Callback< T1, T2 >.onClick.

◆ OnDragReorder()

void UIList.Callback< T1, T2 >.OnDragReorder ( object  obj,
int  a 
)
inline

Implements UIList.ICallback.

Definition at line 160 of file UIList.cs.

161 {
162 if (onDragReorder != null)
163 {
164 onDragReorder((T1)obj, a);
165 }
166 }

References UIList.Callback< T1, T2 >.onDragReorder.

◆ OnList()

void UIList.Callback< T1, T2 >.OnList ( SortMode  mode)
inline

Implements UIList.ICallback.

Definition at line 131 of file UIList.cs.

132 {
133 if (onList != null)
134 {
135 onList(mode);
136 }
137 }
Action< SortMode > onList
Definition: UIList.cs:61

References UIList.Callback< T1, T2 >.onList.

◆ OnRedraw()

void UIList.Callback< T1, T2 >.OnRedraw ( object  obj,
Component  c,
int  index 
)
inline

Implements UIList.ICallback.

Definition at line 139 of file UIList.cs.

140 {
141 if (onRedraw != null)
142 {
143 onRedraw((T1)obj, (T2)c, index);
144 }
145 }
Action< T1, T2, int > onRedraw
Definition: UIList.cs:59

References UIList.Callback< T1, T2 >.onRedraw.

◆ OnRefresh()

void UIList.Callback< T1, T2 >.OnRefresh ( )
inline

Implements UIList.ICallback.

Definition at line 152 of file UIList.cs.

153 {
154 if (onRefresh != null)
155 {
156 onRefresh();
157 }
158 }
Action onRefresh
Definition: UIList.cs:65

References UIList.Callback< T1, T2 >.onRefresh.

◆ OnSort()

int UIList.Callback< T1, T2 >.OnSort ( object  obj,
SortMode  mode 
)
inline

Implements UIList.ICallback.

Definition at line 147 of file UIList.cs.

148 {
149 return onSort((T1)obj, mode);
150 }
Func< T1, SortMode, int > onSort
Definition: UIList.cs:63

References UIList.Callback< T1, T2 >.onSort.

◆ SetList()

void UIList.Callback< T1, T2 >.SetList ( UIList  _list)
inline

Implements UIList.ICallback.

Definition at line 79 of file UIList.cs.

80 {
81 list = _list;
82 }

References UIList.Callback< T1, T2 >.list.

Member Data Documentation

◆ canDragReorder

Func<T1, bool> UIList.Callback< T1, T2 >.canDragReorder

Definition at line 73 of file UIList.cs.

Referenced by UIList.Callback< T1, T2 >.CanDragReorder().

◆ list

◆ mold

◆ onClick

Action<T1, T2> UIList.Callback< T1, T2 >.onClick

Definition at line 57 of file UIList.cs.

Referenced by UIList.Callback< T1, T2 >.OnClick().

◆ onDragReorder

Action<T1, int> UIList.Callback< T1, T2 >.onDragReorder

◆ onInstantiate

Action<T1, T2> UIList.Callback< T1, T2 >.onInstantiate

Definition at line 55 of file UIList.cs.

Referenced by UIList.Callback< T1, T2 >.Instantiate().

◆ onList

Action<SortMode> UIList.Callback< T1, T2 >.onList

Definition at line 61 of file UIList.cs.

Referenced by UIList.Callback< T1, T2 >.OnList().

◆ onRedraw

Action<T1, T2, int> UIList.Callback< T1, T2 >.onRedraw

Definition at line 59 of file UIList.cs.

Referenced by UIList.Callback< T1, T2 >.OnRedraw().

◆ onRefresh

Action UIList.Callback< T1, T2 >.onRefresh

Definition at line 65 of file UIList.cs.

Referenced by UIList.Callback< T1, T2 >.OnRefresh().

◆ onSort

Func<T1, SortMode, int> UIList.Callback< T1, T2 >.onSort

Definition at line 63 of file UIList.cs.

Referenced by UIList.Callback< T1, T2 >.OnSort().

Property Documentation

◆ useOnClick

bool UIList.Callback< T1, T2 >.useOnClick
get

Implements UIList.ICallback.

Definition at line 77 of file UIList.cs.

◆ useSort

bool UIList.Callback< T1, T2 >.useSort
get

Implements UIList.ICallback.

Definition at line 75 of file UIList.cs.


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