C# Класс UISlider, Hero.Coli

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

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

Свойство Тип Описание
current UISlider,
direction Direction,
eventReceiver GameObject
foreground Transform
functionName string
numberOfSteps int
onValueChange OnValueChange
thumb Transform

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

Метод Описание
Awake ( ) : void

Ensure that we have a background and a foreground object to work with.

ForceUpdate ( ) : void

Force-update the slider. Useful if you've changed the properties and want it to update visually.

Init ( ) : void

Initialize the cached values.

OnDrag ( Vector2 delta ) : void

When dragged, figure out where the mouse is and calculate the updated value of the slider.

OnDragThumb ( GameObject go, Vector2 delta ) : void

Callback from the thumb.

OnKey ( KeyCode, key ) : void

Watch for key events and adjust the value accordingly.

OnPress ( bool pressed ) : void

Update the slider's position on press.

OnPressThumb ( GameObject go, bool pressed ) : void

Callback from the thumb.

Set ( float input, bool force ) : void

Update the visible slider.

Start ( ) : void

We want to receive drag events from the thumb.

UpdateDrag ( ) : void

Update the slider's position based on the mouse.

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

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

Ensure that we have a background and a foreground object to work with.
public Awake ( ) : void
Результат void

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

Force-update the slider. Useful if you've changed the properties and want it to update visually.
public ForceUpdate ( ) : void
Результат void

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

Initialize the cached values.
public Init ( ) : void
Результат void

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

When dragged, figure out where the mouse is and calculate the updated value of the slider.
public OnDrag ( Vector2 delta ) : void
delta Vector2
Результат void

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

Callback from the thumb.
public OnDragThumb ( GameObject go, Vector2 delta ) : void
go GameObject
delta Vector2
Результат void

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

Watch for key events and adjust the value accordingly.
public OnKey ( KeyCode, key ) : void
key KeyCode,
Результат void

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

Update the slider's position on press.
public OnPress ( bool pressed ) : void
pressed bool
Результат void

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

Callback from the thumb.
public OnPressThumb ( GameObject go, bool pressed ) : void
go GameObject
pressed bool
Результат void

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

Update the visible slider.
public Set ( float input, bool force ) : void
input float
force bool
Результат void

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

We want to receive drag events from the thumb.
public Start ( ) : void
Результат void

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

Update the slider's position based on the mouse.
public UpdateDrag ( ) : void
Результат void

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

current статическое публичное свойство

Current slider. This value is set prior to the callback function being triggered.
static public UISlider, current
Результат UISlider,

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

Direction the slider will expand in.
public Direction, direction
Результат Direction,

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

Event receiver that will be notified of the value changes.
public GameObject eventReceiver
Результат GameObject

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

Object used for the foreground.
public Transform foreground
Результат Transform

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

Function on the event receiver that will receive the value changes.
public string functionName
Результат string

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

Number of steps the slider should be divided into. For example 5 means possible values of 0, 0.25, 0.5, 0.75, and 1.0.
public int numberOfSteps
Результат int

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

Allow for delegate-based subscriptions for faster events than 'eventReceiver', and allowing for multiple receivers.
public OnValueChange onValueChange
Результат OnValueChange

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

Object that acts as a thumb.
public Transform thumb
Результат Transform