Spinner
Has versions for the int and float types.
Options
Value Min
int/floatMinimal value.
Value Max
int/floatMaximal value.
Step
int/floatStep of the value.
SpinnerValue
int/floatCurrent value.
Validation
SpinnerValidationValidate value on specified event.
OnKeyDownValue checked on every key down event.Some value ranges cannot processed correctly withOnKeyDownvalidation.For example2..10because to enter10you need to enter1and1is not valid value.OnEndInputValue checked when editing has ended.
AllowHold
boolChange value on button hold.
HoldStartDelay
floatDelay of hold in seconds to start change value.
HoldChangeDelay
floatDelay of hold in seconds between each change value.
Plus Button
ButtonAdvancedButton to increase value.
Minus Button
ButtonAdvancedButton to decrease value.
Events
onPlusClick
UnityEventonMinusClick
UnityEvent
Spinner Events
onValueChangeInt
UnityEvent<int>onEndEditInt
UnityEvent<int>
SpinnerFloat Options
Format
stringValue format.
Decimal Separators
char[]Decimal separators.
Number Style
NumberStylesStyle of the number.
SpinnerFloat Events
onValueChangeFloat
UnityEvent<float>onEndEditFloat
UnityEvent<float>
Set maximum
spinner.Max = 100;
Set minimun
spinner.Min = 0;
Set value
spinner.Value = 10;
Set step
spinner.Step = 1;
Get value
Debug.Log(spinner.Value);