Firstborn/Assets/RPG Creation Kit/Scripts/_ General/UI/UISliderValueDisplayer.cs
Schaken-Mods 959e80cf72 assets upload
assets upload description.
2023-03-28 12:16:30 -05:00

25 lines
631 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
namespace RPGCreationKit
{
public class UISliderValueDisplayer : MonoBehaviour
{
[SerializeField] private Slider slider;
[SerializeField] private TextMeshProUGUI _text;
public bool IsAudio = false;
public void Update() {
if (IsAudio == false) {
_text.text = slider.value.ToString("F2");
} else {
float NewValue = slider.value * 100;
_text.text = NewValue.ToString("F2");
}
}
}
}