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