24 lines
478 B
C#
Executable File
24 lines
478 B
C#
Executable File
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}";
|
|
}
|
|
}
|