void SpawnSwimmers() { Quaternion spawnRotation = Quaternion.identity; shuffle(spawnValues); shuffle(colours); for (int i = 0; i < diffCount; i++) { Material color = colours[i]; Vector3 spawnPosition = spawnValues [i]; GameObject newSwimmer = Instantiate(swimmer, spawnPosition, spawnRotation); newSwimmer.GetComponent <ColourGenerator>().SetSwimmerColour(color); swimmers.Add(newSwimmer); Vector3 decoyPosition = spawnValues[i + diffCount]; GameObject decoySwimmer = Instantiate(swimmer, decoyPosition, spawnRotation); ColourGenerator cg = decoySwimmer.GetComponent <ColourGenerator>(); cg.SetSwimmerColour(color); cg.RemoveShark(false); swimmers.Add(decoySwimmer); } swimmersSpawned = true; }