wave list into list or( list into array)


i have problem to make list into list.

i need because i have made so every wave have different monsters and i have multiple waves.

So i need list what contains my wave list like so : waves{wave1,wave2,wave3}

i have code that change wave 1 to wave 2

when i have wave[0] and its ended then i call wave[1].

is there way to make list in list ?

code is here :

        GameObject[] waveykskollid = { vastane1, vastane2, vastane2, vastane2 };

        GameObject[] wavekakskollid = { vastane3, vastane3, vastane3, vastane3 };

        List[] waved = { wave1, wave2 };

You can always make an embedded list or multidimensional array.

List<List<Wave>> waves;
Wave[][] waves;

public class TestWave

	List<GameObject> minionsOfWave = new List<GameObject> ();

	public TestWave()

	public void AddMinion(GameObject minion)
		minionsOfWave.Add (minion);
	public List<GameObject> GetMinions()
		return minionsOfWave;
	public void PrintWave(List<GameObject> minions)


public class WaveManager : MonoBehaviour
	List<TestWave> myWaves;
	TestWave wave;

	// populate these through inspector
	public List<GameObject> wave1;
	public List<GameObject> wave2;

	void Start()
		myWaves = new List<TestWave> ();
		CreateWaves (wave1);
		CreateWaves (wave2);
		PrintWaves ();
	public void CreateWaves(List<GameObject> waveTemp)
		wave = new TestWave ();
		foreach( GameObject minion in waveTemp)
			wave.AddMinion (minion);
			print ("added minion to wave : " + minion.name);
		myWaves.Add (wave);
	public void PrintWaves()
		foreach (TestWave wave in myWaves) 
			int i=1;
					foreach (GameObject minion in wave.GetMinions()) 
				print ("wave #: " + i + minion.name);


just some temporary code to give you a view of how you could achieve your goal

i think you codes are too hard for me i’m really noob.

but i am thankful you responded my question it made me keep trying and it made me search different questions from google what i could not think on my own.

i got it work kinda how i needed but i don’t know is it best way to do it.

i tried this code almost the same as yesterday but there was some sort of mistake in this code. I took some good night sleep and today it worked.

here is code that worked for me:

        List<List<GameObject>> wavedkokku = new List<List<GameObject>>();
        wave = wavedkokku[0];

thanks for replay!