Hey,
I was programming a list, which gives a bit of their objects to other lists:
for (int i = 0;i < spawnerLocations.Length; i++)
{
spawnerLocations[i].ingridientsToSpawn.Clear();
int f = ingridients.Count / spawnerLocations.Length;
while (spawnerLocations[i].ingridientsToSpawn.Count != f)
{
int r = Random.Range(0, ingridients.Count);
spawnerLocations[i].ingridientsToSpawn.Add(ingridients[r]);
ingridients.RemoveAt(r);
Debug.Log(spawnerLocations[i].ingridientsToSpawn.Count);
}
}
Both should have 7 objects in their lists, because the ingridients list has 14 elements, but one of them, the second one, has only 3