Picker

This page explains the structure of Picker, using VerticalPicker as an example.
This Picker can be added by clicking on [GameObject]/[UI]/[Picker]/[Vertical Picker] in the menu.
VerticalPicker and HorizontalPicker have a similar structure.

VerticalPicker

Root object. Component is not attached.

../_images/picker1.png

Glass,Frame

It is the surrounding frame and the center glass.
DontTouchImage component is attached to the substitute of the Image component.
If you want to display something on top of the item (eg Glass),use DontTouchImage as an alternative to the Image component to not interfere with GUI raycasting.
DontTouchImage Through Raycast.This allows you to tap the item behind the DontTouchImage (Item1 in the image below).
../_images/picker3.png

ColumnList

A list of columns. It has the following role.

  • Define the area where columns can be placed

  • Determine layout of multiple columns. (VerticalPicker has HorizontalLayoutGroup attached.)

../_images/picker2.png

Column

The body of the column. Duplicate this object (Ctrl + D) to place multiple columns.
PickerScrollRect component is attached. Basic settings of Picker are on this component.
Content at the top of the Inspector is the object to scroll. Assignment required.
../_images/picker4.png

PickerScrollRect Setting Items

Note

The behavior of the parameters on the inspector can be seen in the demo below.
Assets/PickerForUGUI/Demo/ParameterDemo.unity
../_images/picker5.png

Name

Description

Content

Object to be scrolled. Assignment is required.

Layout

Scroll direction.

MovementType

The behavior when content moves beyond the scroll rectangle.
Infinite: Loop infinitely.
Elastic: behaves like elastic.
Clamped: Stop.

Inertia

Whether to keep the movement after dragging.

Deceleration Rate

The rate of movement speed reduction. Halve the speed by half with 0.5.

Slip Velocity Rate

Stop the slip and scroll to the nearest item if the speed falls below this percentage.

Scroll Sensitivity

Scroll sensitivity.

Scroll Sec From Click

When you tap an item, it takes time to scroll to that item.

Wheel Effect

Reproduces the visual effect of placing the item on the wheel. Reduce the size of the item according to the distance from the center of the Column.

Initial Scroll Position

Set the initial position of the scroll.

Horizontal Scrollbar

Scrollbar object linked to horizontal scroll.

Vertical Scrollbar

Scrollbar object linked to vertical scroll.

When To Send Events

Timing of sending an event.
Always: Sends an OnSelectItem event whenever an item is changed.
Only Scroll Stops: Send OnSelectItem events only when items have changed and scrolling has stopped.

On Select Item ( GameObject )

This is an event that will be called when the selected item is changed. The argument GameObject is the selected item.

On Scroll Changed ( Vector2 )

This event is called when the scroll position changes.

Content

Objects for scrolling and layout management of items.
PickerLayoutGroup component is attached.**Content must have a PickerLayoutGroup component attached.**
Store items in the children of this object.
../_images/picker6.png

Item0/Item1/Item2

The body of the item. It is necessary to attach the PickerItem component (or the class that inherited it).
There are no other restrictions.
GameObject sent on OnSelectItem is this object.
../_images/picker7.png