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;
}