You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
305 B

using System.Reflection.Emit;
using UnityEngine;
using UnityEngine.UI;
[RequireComponent(typeof(Text))]
public class ShowSliderValue : MonoBehaviour
{
public void UpdateLabel (float value)
{
Text lbl = GetComponent<Text>();
if (lbl != null)
lbl.text = Mathf.RoundToInt (value * 100) + "%";
}
}