Create Muk Slider #
To create MukSlider, create and select MukUICanvas, right-click in the Hierarchy > Muk > Slider. You will see a new object(MukSlider) created in the selected canvas or the first canvas in the Hierarchy (if no canvas is selected). If there’s no canvas in the Hierarchy, Muk will create a MukUICanvas for you and place the MukSlider in the newly created MukUICanvas.
Muk Slider Code #
You can get or set few slider’s properties vis script. Please see the code below.
using Muk;
// Assign MukSldier using Inspector window
[SerializeField] private MukSlider mukSlider;
private void Start()
{
mukSlider.minValue = 1;
mukSlider.maxValue = 10;
mukSlider.onValueChanged.AddListener(OnSliderChange);
}
public void OnSliderChange(float value)
{
print("OnSliderChange " + mukSlider.value);
}
Muk Slider - Properties #
Property | Desciption | Value |
---|---|---|
Platform Type | Which UI Platform should Muk Components display. | Device - Base on device. iOS UI for iOS device, Material design for others. iOS - iOS design. Material - Material design. |
Dark Mode | Use Dark mode or light mode. You can set color for each mode in theme settings. | Dark - Dark Mode. Light - Light Mode. |
Override Background Color | Should override the background color of the slider? | If ticked, it will show two options - iOS & Material, and each option will have two options inside(Light Mode color / Dark Mode Color). If not ticked, the system will get color from theme settings. |
Override Fill Color | Should override the fill color (right side of the handle) of the slider? | If ticked, it will show two options - iOS & Material, and each option will have two options inside(Light Mode color / Dark Mode Color). If not ticked, the system will get color from theme settings. |
Override Handle Color | Should override the handle (circle) color of the slider? | If ticked, it will show two options - iOS & Material, and each option will have two options inside(Light Mode color / Dark Mode Color). If not ticked, the system will get color from theme settings. |
Value | The value of the sldier | |
Min Value | The minimum value of the slider | |
Max Value | The minimum value of the slider | |
Whole Number | The value of slider is integer or double? | Ticked - Integer number Unticked - double number |