Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IEnumerator ColorLerp(int id)
- {
- float endTime = Time.time + fadeTime;
- float step = 0;
- while (Time.time < endTime)
- {
- glows[id].color = Color.Lerp(Color.clear, Color.white, step)
- step += Time.deltaTime; // This would only work if you're lerping over 1 second, otherwise you probably wanna divide by your fadeTime somewhere
- yield return null; // Skip one frame, then loop again..
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement