28 lines
433 B
C#
28 lines
433 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class BlinkText : MonoBehaviour
|
|
{
|
|
public Color blinkDstColor;
|
|
|
|
private Color startColor;
|
|
|
|
private Text text;
|
|
|
|
private void Start()
|
|
{
|
|
text = GetComponent<Text>();
|
|
startColor = text.color;
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
text.color = Color.Lerp(startColor, blinkDstColor, Mathf.PingPong(Time.unscaledTime, 1f));
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
text.color = startColor;
|
|
}
|
|
}
|