Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. IEnumerator ColorLerp(int id)
  2. {
  3. float endTime = Time.time + fadeTime;
  4. float step = 0;
  5.  
  6. while (Time.time < endTime)
  7. {
  8. glows[id].color = Color.Lerp(Color.clear, Color.white, step)
  9. step += Time.deltaTime; // This would only work if you're lerping over 1 second, otherwise you probably wanna divide by your fadeTime somewhere
  10. yield return null; // Skip one frame, then loop again..
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement