Files
ScienceLab.AtmosphericPressure/Assets/Scripts/NeonTextAnimation.cs
2026-05-29 18:21:53 +03:00

19 lines
453 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class NeonTextAnimation : MonoBehaviour
{
public TextMeshProUGUI text;
public Color color1 = new Color(0.8f, 0f, 1f);
public Color color2 = new Color(0f, 0.8f, 1f);
public float speed = 1f;
void Update()
{
float t = (Mathf.Sin(Time.time * speed) + 1f) * 0.5f;
text.color = Color.Lerp(color1, color2, t);
}
}