Files
fnl/Assets/Extensions/Le Tai's Asset/TranslucentImage/Demo/Scripts/SetText.cs

23 lines
431 B
C#
Raw Normal View History

2026-02-21 16:40:15 -08:00
using UnityEngine;
using UnityEngine.UI;
namespace LeTai.Asset.TranslucentImage.Demo
{
public class SetText : MonoBehaviour
{
public string format = "0.0";
Text text;
// Use this for initialization
void Awake()
{
text = GetComponent<Text>();
}
public void Set(float value)
{
text.text = value.ToString(format);
}
}
}