public void NextGeneration(Text text) { if (firstGrid == null || secondGrid == null) { text.text = "Must Select Two Grids"; } else { text.text = "Next Generation"; //copy Grids[0].Deserialize(firstGrid); Grids[1].Deserialize(secondGrid); //mutations Grids[2].Deserialize(Mutator.Mutate(firstGrid)); Grids[3].Deserialize(Mutator.Mutate(secondGrid)); //crossovers string[] crosses = Mutator.Crossover(firstGrid, secondGrid); Grids[4].Deserialize(crosses[0]); Grids[5].Deserialize(crosses[1]); //random Grids[6].Randomize(); Grids[7].Randomize(); firstGrid = secondGrid = null; } }