1234567891011121314151617181920212223 |
- using System.Collections;
- using System.Collections.Generic;
- using TMPro;
- using UnityEngine;
- using UnityEngine.UI;
- [RequireComponent(typeof(TMP_Text))]
- public class SliderValueText : MonoBehaviour
- {
- private TMP_Text txt;
- public Slider slider;
- void Awake(){
- txt = GetComponent<TMP_Text>();
- }
- // Update is called once per frame
- void Update()
- {
- txt.text = $"{slider.value- slider.minValue}/{slider.maxValue-slider.minValue}";
- }
- }
|