Last active
August 29, 2015 14:14
-
-
Save nastajus/52101d3312804abe8702 to your computer and use it in GitHub Desktop.
i just wrote this!
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 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