Wave convertGameobjectsToWave(GameObject[] gos) { Wave wave = new Wave(); Dictionary <string, int> minionCount = minionManagement.getMinionCounts(); for (int i = 0; i < gos.Length; i++) { Minion m = gos[i].GetComponent <Minion>(); WaveSection ws = new WaveSection(); ws.minion = gos[i]; ws.rate = 1; ws.count = minionCount[m.minionName]; wave.sections.Add(ws); } return(wave); }