This repository has been archived on 2026-01-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Frontec/Assets/Unity UI Samples/Scripts/ShowSliderValue.cs
jmaniuvc 2936c48466 Frontec
2025-02-24 12:12:52 +09:00

15 lines
305 B
C#

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) + "%";
}
}