Centered Slider
The differences from a default slider:
zero at center
positive and negative parts have different scales.
Options
Interactable
boolAllow users interact with the Slider.
Value
intCurrent value.
Use Value Limits
boolValue cannot exceed the specified limits.
Limit Min
intMinimal limit of the value.
Limit Max
intMaximum limit of the value.
Value Min
intMinimal value.
Value Max
intMaximal value.
Step
intValue step.
Whole Number Of Steps
boolWhole number of steps for the value.
Handle
RangeSliderHandleHandle to drag.
UsableRangeRect
RectTransformUsable range.
FillRect
RectTransformGameObject to display fill (line from center to the current value).
ScrollMode
CenteredSlider.ScrollModesChange the value on the mouse scroll.
IgnoreDo not change the value on the mouse scroll.
UpIncreaseIncrease the value on the mouse wheel up and decrease on the wheel down.
UpDecreaseDecrease the value on the mouse wheel up and increase on the wheel down.
Events
OnValueChanged
UnityEvent<int>OnChange
UnityEvent
Set value
slider.Value = 150;
Set display limits
slider.LimitMin = -500;
slider.LimitMax = 250;
Set value limits
slider.UseValueLimits = true;
slider.ValueMin = -100;
slider.ValueMax = 200;