Hello Everybody,
I have following code,
randomColor = Random.Range(0,5);
//}
var chameleonColor : Color;
if(randomColor == 1.0)
{
GUI.color = Color.blue;
chameleonColor = GUI.color;
}
else
if(randomColor == 2.0)
{
GUI.color = Color.red;
chameleonColor = GUI.color;
}
else
if(randomColor == 3.0)
{
GUI.color = Color.blue;
chameleonColor = GUI.color;
}
else
if(randomColor == 4.0)
{
GUI.color = Color.yellow;
chameleonColor = GUI.color;
}
//GUI.Label (Rect (290.0, 370, 200, 100), "blue");
GUI.Button(chameleon, "chameleon"))
Its changing the color of chameleon based on the random number so that user cant guess which color is coming next. Its changing the color very fast in some miliseconds. What I want to do is that hold a color for 2 seconds and then bring new color. And yes the following code is inside OnGUI().
Thanks,