Signature.


public abstract class ItemViewList<_ItemComponentClass> : MonoBehaviour where _ItemComponentClass : MonoBehaviour, ItemViewList<_ItemComponentClass>.IItemStateUpdate

Description.


ItemViewItem is a class that controls UI elements based on adding, removing, and removing images on the right and one type of item.

To use ItemViewItem, follow these elements:

  1. Defines a class that inherits a dedicated ItemViewList<_ItemComponentClass>.Item that describes the items to be added and deleted.
  2. Defines a dedicated class that inherits ItemViewList<_ItemComponentClass>.
  3. Apply the class that inherited the ItemViewList to the UI GameObject in the game scene as a Component.
  4. Drag and drop the proper elements to the serializeField variables m_prefab_item and m_transform_itemParent.
  5. Override virtual methods if there is a custom action you want.

image.png

Members.


Variables

SerializeField Variables

m_prefab_item Prefab for items that you want to add and remove
m_transform_itemParent Transform on where to add the item

Properties

Public Properties

ItemCount Number of items currently added

Public Static Properties

Instance Instance of current ItemViewList<_ItemComponentClass>
CurSelectedItemIndex index of the currently selected item

Methods

Public Method

AddItem() Add items on call, if you want to deliver additional custom initialization data when creating items, override
RemoveItemAt(in int32) Remove appropriate items according to index
ClearItems() Remove all items
GetItemIndex(in _ItemComponentClass) Return index of given _ItemComponentClass

Protected Method