I have a for loop, adding objects to a list. But it only works the first time, and then just stops functioning. Everything else in the loop works.
public IEnumerator spawnReal(){
for(int y = 0;y < 8;y++){
for(int x = 0;x < 8;x++){
Color color = abilitiesInLevel[level].levelImage.GetPixel(x,y);
if(color != Color.white){
GameObject obj = Instantiate(projectile,new Vector3((x - 4) * 0.6F,5,-6),Quaternion.identity) as GameObject;
orb Orb = obj.GetComponent<orb>();
Debug.Log(Orb.ToString());
orbs.Add(Orb);
Orb.durability = (int)Mathf.Round(color.r * 5.1F);
Orb.type = (int)Mathf.Round(color.g * 5.1F);
Orb.speed = (int)Mathf.Round(color.b * 5.1F);
}
}
yield return new WaitForSeconds(0.3F);
}
yield break;
}