How to grab a variable from another script and use it with a list?

I am trying to create a infinite wave spawner

everytime a wave ends:

add 1 to the array size

within the created element

pick an enemy prefab

add 1 to the enemy count,

adjust the spawn rate

but waves.enemyCount gives me an error of
Error CS1061 ‘List’ does not contain a definition for ‘enemyCount’ and no accessible extension method ‘enemyCount’ accepting a first argument of type ‘List’ could be found (are you missing a using directive or an assembly reference?)

script1:

public List WaveSpawner waves = new List WaveSpawner ();

 IEnumerator SpawnWave()
{
    //amount of enemy spawned
    for (int i = 0; i < waves.enemyCount; i++)
    {
        SpawnEnemy();
        yield return new WaitForSeconds(0.5f);
    }
    waveNumber++;
}

script 2:

[System.Serializable]
public class WaveSpawner
{

public GameObject enemyPrefab;
public int enemyCount;
public float spawnRate;

}

That’s because custom class properties are assigned per index. Meaning, you can access to the value of enemyCount for EACH index in the list ( waves*.enemyCount ), but not the list itself. If you’re trying to get the number of entries your list holds, you have to use waves.Count*