public List<GameObject> top = new List<GameObject>();
public int topnum=0;
public void changetop()
{
Debug.Log ("sucess");
Debug.Log (top.Count);
topnum++;
if (topnum > top.Count - 1)
topnum = 0;
for (int i = 0; i >= top.Count; i++) {
if (i ==topnum)
top [i].SetActive (true);
else
top[i].SetActive(false);
}
}
I wana iterate through list containing gameobjects and activate next one and deactivate rest.
My above code isnt working. Any1 knows wats wrong