mmorpg/Assets/Script/SliderValueText.cs
2024-08-23 16:17:24 +05:30

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}";
}
}