C# Класс UIScrollList, urban-survivors

Наследование: MonoBehaviour, IUIObject
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
activateWhenAdding bool
alignment ALIGNMENT
clipContents bool
clipWhenMoving bool
direction DIRECTION
dragThreshold float
itemSpacing float
manager SpriteManager,
methodToInvokeOnSelect string
orientation ORIENTATION
prefabItems PrefabListItem[],
sceneItems GameObject[]
scriptWithMethodToInvoke MonoBehaviour
slider UISlider,
spacingAtEnds bool
touchScroll bool
viewableArea Vector2

Защищенные свойства (Protected)

Свойство Тип Описание
cachedPos Vector3
cachedRot Quaternion
cachedScale Vector3
changeDelegate EZValueChangedDelegate
clientClippingRect Rect3D
container IUIContainer
contentExtents float
inputDelegate EZInputDelegate
isScrolling bool
items List
m_controlIsEnabled bool
m_started bool
mover GameObject
noTouch bool
scrollMax float
scrollPos float
selectedItem IUIListObject
tempVisItems List
visibleItems List

Открытые методы

Метод Описание
AddInputDelegate ( EZInputDelegate del ) : void
AddItem ( GameObject itemGO ) : void

Adds an item to the end of the list. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.

AddItem ( IUIListObject item ) : void

Adds an item to the end of the list. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.

AddItem ( IUIListObject item, string text ) : void

Adds an item to the end of the list. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.

AddValueChangedDelegate ( EZValueChangedDelegate del ) : void
Awake ( ) : void
ClearList ( bool destroy ) : void

Empties the contents of the list entirely. Destroys the items if instructed, otherwise it just deactivates them.

Create ( string name, Vector3 pos ) : UIScrollList,

Creates a GameObject and attaches this component type to it.

Create ( string name, Vector3 pos, Quaternion rotation ) : UIScrollList,

Creates a GameObject and attaches this component type to it.

CreateItem ( GameObject prefab ) : IUIListObject

Instantiates a new list item based on the prefab to clone, adds it to the end of the list and returns a reference to it. NOTE: The prefab/GameObject is required to have a component that implements IUIListObject. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.

CreateItem ( GameObject prefab, int position ) : IUIListObject

Instantiates a new list item based on the prefab to clone, adds it to the list at the position specified by "position" and returns a reference to it. NOTE: The prefab/GameObject is required to have a component that implements IUIListObject. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.

CreateItem ( GameObject prefab, int position, string text ) : IUIListObject

Instantiates a new list item based on the prefab to clone, adds it to the list at the position specified by "position" and returns a reference to it. NOTE: The prefab/GameObject is required to have a component that implements IUIListObject. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.

CreateItem ( GameObject prefab, string text ) : IUIListObject

Instantiates a new list item based on the prefab to clone, adds it to the end of the list and returns a reference to it. NOTE: The prefab/GameObject is required to have a component that implements IUIListObject. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.

DidClick ( IUIListObject item ) : void
DidSelect ( IUIListObject item ) : void
GetItem ( int index ) : IUIListObject

Returns a reference to the specified list item.

GotFocus ( ) : bool
InsertItem ( IUIListObject item, int position ) : void

Inserts a list item at the specified position in the list.

InsertItem ( IUIListObject item, int position, string text ) : void

Inserts a list item at the specified position in the list.

ListDragged ( POINTER_INFO, ptr ) : void
OnDrawGizmosSelected ( ) : void
OnEnable ( ) : void
OnInput ( POINTER_INFO, ptr ) : void
PointerReleased ( ) : void
PositionItems ( ) : void

Positions list items according to the current scroll position.

RemoveInputDelegate ( EZInputDelegate del ) : void
RemoveItem ( IUIListObject item, bool destroy ) : void

Removes the specified item. Remaining items are repositioned to fill the gap. The removed item is destroyed if 'destroy' is true. Otherwise, it is deactivated.

RemoveItem ( int index, bool destroy ) : void

Removes the item at the specified index. Remaining items are repositioned to fill the gap. The removed item is destroyed if 'destroy' is true. Otherwise, it is deactivated.

RemoveValueChangedDelegate ( EZValueChangedDelegate del ) : void
RepositionItems ( ) : void

Repositions list items according to the current scroll position, and adjusts for any change in the items' extents.

RequestContainership ( IUIContainer cont ) : bool
ScrollListTo ( float pos ) : void

Scrolls the list directly to the position indicated (0-1).

SetInputDelegate ( EZInputDelegate del ) : void
SetSelectedItem ( int index ) : void

Sets the item at the specified index as the currently selected item.

SetValueChangedDelegate ( EZValueChangedDelegate del ) : void
SliderMoved ( IUIObject slider ) : void
Start ( ) : void
Update ( ) : void

Защищенные методы

Метод Описание
AddItemsToContainer ( ) : void
CalcClippingRect ( ) : void
ClipItems ( ) : void
PositionHorizontally ( bool updateExtents ) : void
PositionVertically ( bool updateExtents ) : void
RemoveItemsFromContainer ( ) : void
ScrollListTo_Internal ( float pos ) : void
UpdateContentExtents ( float change ) : void

Описание методов

AddInputDelegate() публичный Метод

public AddInputDelegate ( EZInputDelegate del ) : void
del EZInputDelegate
Результат void

AddItem() публичный Метод

Adds an item to the end of the list. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.
public AddItem ( GameObject itemGO ) : void
itemGO GameObject
Результат void

AddItem() публичный Метод

Adds an item to the end of the list. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.
public AddItem ( IUIListObject item ) : void
item IUIListObject Reference to the list item to be added.
Результат void

AddItem() публичный Метод

Adds an item to the end of the list. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.
public AddItem ( IUIListObject item, string text ) : void
item IUIListObject Reference to the list item to be added.
text string Text to display in the item (requires that the item has a TextMesh associated with it, preferably in a child GameObject).
Результат void

AddItemsToContainer() защищенный Метод

protected AddItemsToContainer ( ) : void
Результат void

AddValueChangedDelegate() публичный Метод

public AddValueChangedDelegate ( EZValueChangedDelegate del ) : void
del EZValueChangedDelegate
Результат void

Awake() публичный Метод

public Awake ( ) : void
Результат void

CalcClippingRect() защищенный Метод

protected CalcClippingRect ( ) : void
Результат void

ClearList() публичный Метод

Empties the contents of the list entirely. Destroys the items if instructed, otherwise it just deactivates them.
public ClearList ( bool destroy ) : void
destroy bool When true, the list items are actually destroyed. Otherwise, they are deactivated.
Результат void

ClipItems() защищенный Метод

protected ClipItems ( ) : void
Результат void

Create() статический публичный Метод

Creates a GameObject and attaches this component type to it.
static public Create ( string name, Vector3 pos ) : UIScrollList,
name string Name to give to the new GameObject.
pos Vector3 Position, in world space, where the new object should be created.
Результат UIScrollList,

Create() статический публичный Метод

Creates a GameObject and attaches this component type to it.
static public Create ( string name, Vector3 pos, Quaternion rotation ) : UIScrollList,
name string Name to give to the new GameObject.
pos Vector3 Position, in world space, where the new object should be created.
rotation Quaternion Rotation of the object.
Результат UIScrollList,

CreateItem() публичный Метод

Instantiates a new list item based on the prefab to clone, adds it to the end of the list and returns a reference to it. NOTE: The prefab/GameObject is required to have a component that implements IUIListObject. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.
public CreateItem ( GameObject prefab ) : IUIListObject
prefab GameObject GameObject/Prefab which is to be instantiated and added to the end of the list.
Результат IUIListObject

CreateItem() публичный Метод

Instantiates a new list item based on the prefab to clone, adds it to the list at the position specified by "position" and returns a reference to it. NOTE: The prefab/GameObject is required to have a component that implements IUIListObject. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.
public CreateItem ( GameObject prefab, int position ) : IUIListObject
prefab GameObject GameObject/Prefab which is to be instantiated and added to the end of the list.
position int 0-based index where the new item will be placed in the list.
Результат IUIListObject

CreateItem() публичный Метод

Instantiates a new list item based on the prefab to clone, adds it to the list at the position specified by "position" and returns a reference to it. NOTE: The prefab/GameObject is required to have a component that implements IUIListObject. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.
public CreateItem ( GameObject prefab, int position, string text ) : IUIListObject
prefab GameObject GameObject/Prefab which is to be instantiated and added to the end of the list.
position int 0-based index where the new item will be placed in the list.
text string Text to display in the item (requires that the item has a TextMesh associated with it, preferably in a child GameObject).
Результат IUIListObject

CreateItem() публичный Метод

Instantiates a new list item based on the prefab to clone, adds it to the end of the list and returns a reference to it. NOTE: The prefab/GameObject is required to have a component that implements IUIListObject. NOTE: For proper appearance, list items should each be of uniform width when the list is vertical, and of uniform height when the list is horizontal. Besides that, list items can vary in size.
public CreateItem ( GameObject prefab, string text ) : IUIListObject
prefab GameObject GameObject/Prefab which is to be instantiated and added to the end of the list.
text string Text to display in the item (requires that the item has a TextMesh associated with it, preferably in a child GameObject).
Результат IUIListObject

DidClick() публичный Метод

public DidClick ( IUIListObject item ) : void
item IUIListObject
Результат void

DidSelect() публичный Метод

public DidSelect ( IUIListObject item ) : void
item IUIListObject
Результат void

GetItem() публичный Метод

Returns a reference to the specified list item.
public GetItem ( int index ) : IUIListObject
index int Index of the item to retrieve.
Результат IUIListObject

GotFocus() публичный Метод

public GotFocus ( ) : bool
Результат bool

InsertItem() публичный Метод

Inserts a list item at the specified position in the list.
public InsertItem ( IUIListObject item, int position ) : void
item IUIListObject Reference to the item to be inserted into the list.
position int 0-based index of the position in the list where the item will be placed.
Результат void

InsertItem() публичный Метод

Inserts a list item at the specified position in the list.
public InsertItem ( IUIListObject item, int position, string text ) : void
item IUIListObject Reference to the item to be inserted into the list.
position int 0-based index of the position in the list where the item will be placed.
text string Text to display in the item (requires that the item has a TextMesh associated with it, preferably in a child GameObject).
Результат void

ListDragged() публичный Метод

public ListDragged ( POINTER_INFO, ptr ) : void
ptr POINTER_INFO,
Результат void

OnDrawGizmosSelected() публичный Метод

public OnDrawGizmosSelected ( ) : void
Результат void

OnEnable() публичный Метод

public OnEnable ( ) : void
Результат void

OnInput() публичный Метод

public OnInput ( POINTER_INFO, ptr ) : void
ptr POINTER_INFO,
Результат void

PointerReleased() публичный Метод

public PointerReleased ( ) : void
Результат void

PositionHorizontally() защищенный Метод

protected PositionHorizontally ( bool updateExtents ) : void
updateExtents bool
Результат void

PositionItems() публичный Метод

Positions list items according to the current scroll position.
public PositionItems ( ) : void
Результат void

PositionVertically() защищенный Метод

protected PositionVertically ( bool updateExtents ) : void
updateExtents bool
Результат void

RemoveInputDelegate() публичный Метод

public RemoveInputDelegate ( EZInputDelegate del ) : void
del EZInputDelegate
Результат void

RemoveItem() публичный Метод

Removes the specified item. Remaining items are repositioned to fill the gap. The removed item is destroyed if 'destroy' is true. Otherwise, it is deactivated.
public RemoveItem ( IUIListObject item, bool destroy ) : void
item IUIListObject
destroy bool
Результат void

RemoveItem() публичный Метод

Removes the item at the specified index. Remaining items are repositioned to fill the gap. The removed item is destroyed if 'destroy' is true. Otherwise, it is deactivated.
public RemoveItem ( int index, bool destroy ) : void
index int Index of the item to remove.
destroy bool
Результат void

RemoveItemsFromContainer() защищенный Метод

protected RemoveItemsFromContainer ( ) : void
Результат void

RemoveValueChangedDelegate() публичный Метод

public RemoveValueChangedDelegate ( EZValueChangedDelegate del ) : void
del EZValueChangedDelegate
Результат void

RepositionItems() публичный Метод

Repositions list items according to the current scroll position, and adjusts for any change in the items' extents.
public RepositionItems ( ) : void
Результат void

RequestContainership() публичный Метод

public RequestContainership ( IUIContainer cont ) : bool
cont IUIContainer
Результат bool

ScrollListTo() публичный Метод

Scrolls the list directly to the position indicated (0-1).
public ScrollListTo ( float pos ) : void
pos float Position of the list - 0-1 (0 == beginning, 1 == end)
Результат void

ScrollListTo_Internal() защищенный Метод

protected ScrollListTo_Internal ( float pos ) : void
pos float
Результат void

SetInputDelegate() публичный Метод

public SetInputDelegate ( EZInputDelegate del ) : void
del EZInputDelegate
Результат void

SetSelectedItem() публичный Метод

Sets the item at the specified index as the currently selected item.
public SetSelectedItem ( int index ) : void
index int The zero-based index of the item.
Результат void

SetValueChangedDelegate() публичный Метод

public SetValueChangedDelegate ( EZValueChangedDelegate del ) : void
del EZValueChangedDelegate
Результат void

SliderMoved() публичный Метод

public SliderMoved ( IUIObject slider ) : void
slider IUIObject
Результат void

Start() публичный Метод

public Start ( ) : void
Результат void

Update() публичный Метод

public Update ( ) : void
Результат void

UpdateContentExtents() защищенный Метод

protected UpdateContentExtents ( float change ) : void
change float
Результат void

Описание свойств

activateWhenAdding публичное свойство

When true, items added or inserted to this list will be activated recursively. This is STRONGLY recommended when using managed sprites/controls.
public bool activateWhenAdding
Результат bool

alignment публичное свойство

Determines how the items will be aligned in the list when added. See UIScrollList.ALIGNMENT [ALIGNMENT]
public ALIGNMENT alignment
Результат ALIGNMENT

cachedPos защищенное свойство

protected Vector3 cachedPos
Результат Vector3

cachedRot защищенное свойство

protected Quaternion cachedRot
Результат Quaternion

cachedScale защищенное свойство

protected Vector3 cachedScale
Результат Vector3

changeDelegate защищенное свойство

protected EZValueChangedDelegate changeDelegate
Результат EZValueChangedDelegate

clientClippingRect защищенное свойство

protected Rect3D clientClippingRect
Результат Rect3D

clipContents публичное свойство

When true, the contents of the list will be clipped to the viewable area. Otherwise, the content will extend beyond the specified viewable area.
public bool clipContents
Результат bool

clipWhenMoving публичное свойство

When true, items will be clipped each frame in which it is detected that the list has moved, rotated, or scaled. Use this if you are having clipping errors after scaling, rotating, etc, a list as part of a panel transition, etc. Leave set to false otherwise to improve performance.
public bool clipWhenMoving
Результат bool

container защищенное свойство

protected IUIContainer container
Результат IUIContainer

contentExtents защищенное свойство

protected float contentExtents
Результат float

direction публичное свойство

Determines whether items will be added to the list from top-to-bottom and left-to-right, or from bottom-to-top and right-to-left. See UIScrollList.DIRECTION [DIRECTION]
public DIRECTION direction
Результат DIRECTION

dragThreshold публичное свойство

Distance the pointer must travel beyond which when it is released, the item under the pointer will not be considered to have been selected. This allows touch scrolling without inadvertently selecting the item under the pointer.
public float dragThreshold
Результат float

inputDelegate защищенное свойство

protected EZInputDelegate inputDelegate
Результат EZInputDelegate

isScrolling защищенное свойство

protected bool isScrolling
Результат bool

itemSpacing публичное свойство

Empty space to put between each list item.
public float itemSpacing
Результат float

items защищенное свойство

protected List items
Результат List

m_controlIsEnabled защищенное свойство

protected bool m_controlIsEnabled
Результат bool

m_started защищенное свойство

protected bool m_started
Результат bool

manager публичное свойство

(Optional) Manager to which instantiated list items should be added once created. If none is set, sprites must either be unmanaged, or must already have been added to a manager.
public SpriteManager, manager
Результат SpriteManager,

methodToInvokeOnSelect публичное свойство

A string containing the name of the method to be invoked when an item is selected.
public string methodToInvokeOnSelect
Результат string

mover защищенное свойство

protected GameObject mover
Результат GameObject

noTouch защищенное свойство

protected bool noTouch
Результат bool

orientation публичное свойство

The orientation of the list - horizontal or vertical.
public ORIENTATION orientation
Результат ORIENTATION

prefabItems публичное свойство

Optional array of item prefabs that are to be added to the list on startup. These will be added after the items in the sceneItems array.
public PrefabListItem[], prefabItems
Результат PrefabListItem[],

sceneItems публичное свойство

Optional array of items in the scene that are to be added to the list on startup. These will be added before the items in the prefabItems array.
public GameObject[] sceneItems
Результат GameObject[]

scriptWithMethodToInvoke публичное свойство

Reference to the script component with the method you wish to invoke when an item is selected.
public MonoBehaviour scriptWithMethodToInvoke
Результат MonoBehaviour

scrollMax защищенное свойство

protected float scrollMax
Результат float

scrollPos защищенное свойство

protected float scrollPos
Результат float

selectedItem защищенное свойство

protected IUIListObject selectedItem
Результат IUIListObject

slider публичное свойство

An optional slider control that will control the scroll position of the list.
public UISlider, slider
Результат UISlider,

spacingAtEnds публичное свойство

When set to true, the itemSpacing value will be applied before the first item, and after the last so as to "pad" the first and last items a bit from the edge. If false, the first and last items will be flush with the edges of the viewable area.
public bool spacingAtEnds
Результат bool

tempVisItems защищенное свойство

protected List tempVisItems
Результат List

touchScroll публичное свойство

When true, scrolling will operate like a scrollable list on an iPhone - when a pointing device (normally a finger) is dragged across it, it scrolls and coasts to an eventual stop if not stopped manually.
public bool touchScroll
Результат bool

viewableArea публичное свойство

The extents of the viewable area, in local space units. The contents of the list will be clipped to this area. Ex: If an area of 10x10 is specified, the list contents will be clipped 5 units above the center of the scroll list's GameObject, 5 units below, and 5 units on either side.
public Vector2 viewableArea
Результат Vector2

visibleItems защищенное свойство

protected List visibleItems
Результат List