Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Return the current color of the particle.
- private Color GetColor()
- {
- int index = timer * (color.Length - 1) / lifeTime + 1;
- if (color.Length <= index)
- {
- return color[index - 1];
- }
- Color color1 = color[index - 1];
- Color color2 = color[index];
- return Color.Lerp(color1, color2, (float)timer * (color.Length - 1) / lifeTime - index + 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment