30 lines
782 B
C#
30 lines
782 B
C#
using UnityEngine;
|
|
|
|
public class EndlessWaveManager : WaveManager
|
|
{
|
|
[SerializeField] private Enemy[] enemyList;
|
|
[SerializeField] private Enemy[] bossList;
|
|
[SerializeField] private int bossWaveInterval;
|
|
[Header("Enemy Count Calculations")]
|
|
[SerializeField] private float baseSpawnAmount;
|
|
[SerializeField] private float exponentIncrease;
|
|
protected override void SpawnWave()
|
|
{
|
|
waveUI.text = $"Wave: {wave}";
|
|
int amountToSpawn = Mathf.FloorToInt(baseSpawnAmount * Mathf.Pow(wave, exponentIncrease));
|
|
for (int i = 0; i < amountToSpawn; i++)
|
|
{
|
|
SpawnEnemy(enemyList[Random.Range(0, enemyList.Length)]);
|
|
}
|
|
if (wave % bossWaveInterval == 0)
|
|
{
|
|
SpawnBoss(bossList[Random.Range(0, bossList.Length)]);
|
|
}
|
|
wave++;
|
|
}
|
|
|
|
public override void UpdateKills()
|
|
{
|
|
|
|
}
|
|
}
|