Slider for speed implemented
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class SliderScript : MonoBehaviour
|
||||
{
|
||||
|
||||
[SerializeField] private Slider _slider;
|
||||
[SerializeField] private TextMeshProUGUI _sliderText;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
_slider.onValueChanged.AddListener((v) =>
|
||||
{
|
||||
_sliderText.text = v.ToString("0.00");
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user