Skip to content

Instantly share code, notes, and snippets.

@nastajus
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nastajus/52101d3312804abe8702 to your computer and use it in GitHub Desktop.
Save nastajus/52101d3312804abe8702 to your computer and use it in GitHub Desktop.
i just wrote this!
using UnityEngine;
public class _Ha : MonoBehaviour {
float red = 0x00;
float green = 0x00;
float blue = 0x00;
const int step = 1;
const int min = 0x08;
const int max = 0xFF;
void Update () {
red += step;
red %= ( red % max == 0 ) ? min : max;
Color color = new Color(red / 0xFF, green / 0xFF, blue / 0xFF, 1);
gameObject.renderer.material.color = color;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment