My code has some invalid arguments. I am trying to change the color of a game object’s shader (Emission color) to Red and Green with the probability of a 70% of getting the color of green, and a 30% chance of getting the color of red after the thirty seconds, but I cant get it right. Before the thirty seconds, script should be inactive. What am I doing wrong?
public GameObject Rings;
public int Time;
public Color ColorRed;
public Color ColorGreen;
// Use this for initialization
void Start () {
ColorRed = Color.red;
ColorGreen = Color.green;
if (System.Threading.Thread.Sleep (Time>30000))
{
Rings = GameObject.FindGameObjectWithTag ("Rings");
Renderer rend = GetComponent<Renderer> ();
rend.material.shader = Shader.Find ("_EmmissionColor");
rend.material.SetColor (Color.red, Color.green);
}
}