initial commit
This commit is contained in:
18
Assets/Scripts/NeonTextAnimation.cs
Normal file
18
Assets/Scripts/NeonTextAnimation.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user