UIGroup

UIGroup component allows you to create a group of items and get access to any item by name or id.

UIGroup group = GetComponent<UIGroup>();

// get by id
UIItem firstItem = group.GetItem(0);

// get by name
UIItem itemByName = group.GetItem("item (2)");

There is a two items detection modes available

  • Automatic (default)
  • Manual

In “Automatic” mode UIGroup detects items from its children.

NOTE: Disabled game objects and game objects with disabled UIItem component are ignores.

”Manual” mode allows to define items for group from anywhere in hierarchy.

Details

For each group item the UIItem.group parameter will be linked to current group.

You may need to force re-init group when items count has been changed in runtime in hierarchy (item added/removed, enabled/disabled)

UIGroup group = GetComponent<UIGroup>();
group.InitForce();

Supported items classes are UIItem and all it descendant.

Summary
UIGroupUIGroup component allows you to create a group of items and get access to any item by name or id.
Variables
itemsArray of UIItem items assigned to current group
Functions
GetItem (id)Find item by id in items array
GetItem (name)Find item by name in items array

Variables

items

public UIItem [] items

Array of UIItem items assigned to current group

Debug.Log("UIGroup items count = " + GetComponent<UIGroup>().items.Length);

Functions

GetItem (id)

public UIItem GetItem(int id)

Find item by id in items array

UIItem item = GetComponent<UIGroup>().GetItem(0);

Parameters

iditem id from items array

Returns

Found UIItem or null

GetItem (name)

public UIItem GetItem(string name)

Find item by name in items array

UIItem item = GetComponent<UIGroup>().GetItem("item 1");

Parameters

nameitem name

Returns

Found UIItem or null

RichMonoBehaviour is a base class for all UItools components.
UIStateGroup allows to manage group of UIStateItem items and perform bulk state change
UIGroup component allows you to create a group of items and get access to any item by name or id.
public UIItem [] items
Array of UIItem items assigned to current group
UIItem is one of the base components that implements core item properties.
public UIItem GetItem(int id)
Find item by id in items array
public UIItem GetItem(string name)
Find item by name in items array
public UIGroup group
Link to UIGroup object this item belongs to
Close