Elin Decompiled Documentation EA 23.253 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 52 of file UIList.cs.

Member Function Documentation

◆ CanDragReorder()

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

Implements UIList.ICallback.

Definition at line 167 of file UIList.cs.

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

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

◆ CreateMold()

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

Implements UIList.ICallback.

Definition at line 83 of file UIList.cs.

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

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 176 of file UIList.cs.

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

◆ GetMold()

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

Implements UIList.ICallback.

Definition at line 91 of file UIList.cs.

92 {
93 return mold;
94 }

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

◆ Instantiate()

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

Implements UIList.ICallback.

Definition at line 96 of file UIList.cs.

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

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 122 of file UIList.cs.

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

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

◆ OnDragReorder()

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

Implements UIList.ICallback.

Definition at line 159 of file UIList.cs.

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

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

◆ OnList()

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

Implements UIList.ICallback.

Definition at line 130 of file UIList.cs.

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

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 138 of file UIList.cs.

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

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

◆ OnRefresh()

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

Implements UIList.ICallback.

Definition at line 151 of file UIList.cs.

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

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

◆ OnSort()

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

Implements UIList.ICallback.

Definition at line 146 of file UIList.cs.

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

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

◆ SetList()

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

Implements UIList.ICallback.

Definition at line 78 of file UIList.cs.

79 {
80 list = _list;
81 }

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

Member Data Documentation

◆ canDragReorder

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

Definition at line 72 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 56 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 54 of file UIList.cs.

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

◆ onList

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

Definition at line 60 of file UIList.cs.

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

◆ onRedraw

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

Definition at line 58 of file UIList.cs.

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

◆ onRefresh

Action UIList.Callback< T1, T2 >.onRefresh

Definition at line 64 of file UIList.cs.

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

◆ onSort

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

Definition at line 62 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 76 of file UIList.cs.

◆ useSort

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

Implements UIList.ICallback.

Definition at line 74 of file UIList.cs.


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