Class UICollection
This component represents and ordered collection of UI elements. You
can add to the UICollection by either dropping UI elements in the UI
element this component is attached to in the Editor or by calling the
AddItem(RectTransform) method. UI elements that are added to this
collection via the Editor will be automatically arranged when this
component executes.
To use this component attach it to a UI element (a GameObject with a
RectTransform component) such as an Image or Panel.
Assembly: cs.temp.dll.dll
public class UICollection : MonoBehaviour, MonoBehaviour
Properties
Declaration
public float HorizontalSpacing { get; set; }
Property Value
Declaration
public float HorizontalSpacing { get; set; }
Property Value
A list of items in this collection. This list should not be modified directly. Instead
use AddItem(RectTransform) and RemoveItem(RectTransform).
Declaration
public List<RectTransform> Items { get; }
Property Value
Type |
Description |
List<RectTransform> |
|
A list of items in this collection. This list should not be modified directly. Instead
use AddItem(RectTransform) and RemoveItem(RectTransform).
Declaration
public List<RectTransform> Items { get; }
Property Value
Type |
Description |
List<RectTransform> |
|
Declaration
public float MaxHeight { get; set; }
Property Value
Declaration
public float MaxHeight { get; set; }
Property Value
Declaration
public float MaxWidth { get; set; }
Property Value
Declaration
public float MaxWidth { get; set; }
Property Value
Declaration
public float VerticalSpacing { get; set; }
Property Value
Declaration
public float VerticalSpacing { get; set; }
Property Value
Methods
Adds a UI element to the collection. This will cause the collection
layout to update immediately.
NOTE: The added item's RectTransform will get modified in order to layout properly in this collection.
Declaration
public void AddItem(RectTransform item)
Parameters
Type |
Name |
Description |
RectTransform |
item |
The UI element to add to the collection.
|
Adds a UI element to the collection. This will cause the collection
layout to update immediately.
NOTE: The added item's RectTransform will get modified in order to layout properly in this collection.
Declaration
public void AddItem(RectTransform item)
Parameters
Type |
Name |
Description |
RectTransform |
item |
The UI element to add to the collection.
|
Removes all UI elements added to the collection. This will cause the collection
layout to update immediately.
NOTE: This method does not call Destroy removed items.
Declaration
public void RemoveAllItems()
Removes all UI elements added to the collection. This will cause the collection
layout to update immediately.
NOTE: This method does not call Destroy removed items.
Declaration
public void RemoveAllItems()
Removes a UI element from the collection. This will cause the collection
layout to update immediately.
NOTE: This method does not call Destroy removed items.
Declaration
public void RemoveItem(RectTransform item)
Parameters
Type |
Name |
Description |
RectTransform |
item |
The UI element to remove from the collection.
|
Removes a UI element from the collection. This will cause the collection
layout to update immediately.
NOTE: This method does not call Destroy removed items.
Declaration
public void RemoveItem(RectTransform item)
Parameters
Type |
Name |
Description |
RectTransform |
item |
The UI element to remove from the collection.
|
Declaration
protected virtual void UpdateLayout()
Declaration
protected virtual void UpdateLayout()
Implements
MonoBehaviour