summaryrefslogtreecommitdiff
path: root/Assets/SampleUI/Scripts/ShowSliderValue.cs
blob: 99b30aac00959a35a8873c91f1b137646aa21366 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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) + "%";
	}
}