Skip to main content

Slider

info
  • This class is only available in a Local environment

The Slider class is a component which interacts with Unity Sliders on UI.

caution

The Slider class is only compatible with TextMeshPro.

To get a Slider from an item, use the GetComponent method.

let sliderComponent = item.GetComponent("Slider")

You can then use the sliderComponent property to access the Slider class.

Methods

Method NameReturn TypeParametersDescription
GetValuefloatnoneGets the current slider value
SetValuevoidfloatSets the current slider value
RegisterValueChangedvoidfunction(float)Registers an event for when the slider value is changed
RemoveAllValuesChangedvoidnoneRemoves all events for when the slider value is changed
GetMinimumfloatnoneGets the current minimum value for the slider
GetMaximumfloatnoneGets the current maximum value for the slider
SetRangevoidfloat, floatSets the minimum and then maximum range for the slider
GetColorBlockColorBlock?noneGets the ColorBlock for the element
SetColorBlockvoidColorBlockSets the ColorBlock for the element