private void ResetSelf(bool match) { ps.Emit(50); transform.position = startPos; c.ResetBall(match); float colR = Random.Range(0.0f, 3.0f); switch ((int)colR) { case 0: myColor = "Y"; GetComponent <MeshRenderer> ().material.color = new Color(1.0f, 0.5f, 1.0f); break; case 1: myColor = "G"; GetComponent <MeshRenderer> ().material.color = Color.green; break; case 2: myColor = "B"; GetComponent <MeshRenderer> ().material.color = Color.blue; break; } SetGrav(); }