Created
February 13, 2020 23:47
-
-
Save Lkledu/ae2e03f63c707dd041cc2a5c340296ad to your computer and use it in GitHub Desktop.
blink text color
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class blinkText : MonoBehaviour | |
{ | |
Text txt; | |
void Start(){ | |
txt = GetComponent<Text>(); | |
} | |
void Update() | |
{ | |
txt.color = Color.Lerp(Color.white, Color.black, Mathf.PingPong(Time.time, 0.5f)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment