Class ItemSelector<T>
A generic class that keeps track of our current (and previous) generic item selection in a collection.
(e.g. radio button, selecting one element out of a list).
Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
ItemSelector<T>
Assembly: Assembly-CSharp.dll
Syntax
public class ItemSelector<T> : ThemeElement, IColorHook
Type Parameters
Fields
|
Improve this Doc
View Source
m_items
Declaration
[SerializeField]
protected Collection<T> m_items
Field Value
Type |
Description |
System.Collections.ObjectModel.Collection<T> |
|
|
Improve this Doc
View Source
onDeselected
Declaration
public ItemSelector<T>.OnDeselected onDeselected
Field Value
|
Improve this Doc
View Source
onSelected
Declaration
public ItemSelector<T>.OnSelected onSelected
Field Value
|
Improve this Doc
View Source
onSelectionChange
Declaration
public ItemSelector<T>.OnSelectionChange onSelectionChange
Field Value
Methods
|
Improve this Doc
View Source
AddItem(T)
Declaration
public void AddItem(T item)
Parameters
Type |
Name |
Description |
T |
item |
|
|
Improve this Doc
View Source
Clear()
Declaration
|
Improve this Doc
View Source
GetCount()
Declaration
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
GetCurrentIndex()
Declaration
public int GetCurrentIndex()
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
GetCurrentItem()
Returns the current visible item
Declaration
public T GetCurrentItem()
Returns
|
Improve this Doc
View Source
GetItems()
Declaration
public Collection<T> GetItems()
Returns
Type |
Description |
System.Collections.ObjectModel.Collection<T> |
|
|
Improve this Doc
View Source
GetLastSelectedItem()
Declaration
public T GetLastSelectedItem()
Returns
|
Improve this Doc
View Source
Initialize(IEnumerable<T>)
Initializes with a specific set of objects
Declaration
protected virtual void Initialize(IEnumerable<T> allSelectionItems)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<T> |
allSelectionItems |
|
|
Improve this Doc
View Source
NextItem()
Selects the next item in the collection
Declaration
|
Improve this Doc
View Source
PreviousItem()
Selects the previous item in the collection
Declaration
public void PreviousItem()
|
Improve this Doc
View Source
RemoveItem(T)
Declaration
public void RemoveItem(T item)
Parameters
Type |
Name |
Description |
T |
item |
|
|
Improve this Doc
View Source
Select(T)
If your item is within our list, we will set the current item to it.
Declaration
public bool Select(T itemInList)
Parameters
Type |
Name |
Description |
T |
itemInList |
|
Returns
Type |
Description |
System.Boolean |
|
Implements