这是我加载敌人的代码我试图实现一个波浪系统,在杀死所有敌人或时间限制后进入下一波我正在寻找一种方法来实现它谢谢:)
public void LoadEnemies()
{
if (spawn >= 1)
{
spawn = 0;
if (enemies.Count() < 5)
{
SpawnEnemy(new Vector2(1500, 100));
SpawnEnemy(new Vector2(1600, 200));
SpawnEnemy(new Vector2(1700, 300));
SpawnEnemy(new Vector2(1800, 400));
SpawnEnemy(new Vector2(1900, 500));
}
}
for (int i = 0; i < enemies.Count; i++)
if (!enemies[i].isVisible)
{
enemies.RemoveAt(i);
i--;
}
}