diff --git a/Assets/Scripts/Arena.cs b/Assets/Scripts/Arena.cs index df11122..334d7f4 100644 --- a/Assets/Scripts/Arena.cs +++ b/Assets/Scripts/Arena.cs @@ -84,10 +84,10 @@ public class Arena : MonoBehaviour { soundManager.PlaySound(waveSource, waveSounds, randomPitch: true, createTempSourceIfBusy: true); while (amountSpawned < currWaveSize) { currentSpawner = Random.Range(0, spawners.Length); - if(currWaveSize >= .5*stats.maxWaveSize && lightAmountSpawned <= stats.maxWaveSize * stats.lightRatio){ + if(currWaveSize >= stats.regularBeforeLight && lightAmountSpawned <= stats.maxWaveSize * stats.lightRatio){ SpawnEnemy(currentSpawner, lightGladiator); lightAmountSpawned++; - }else if(currWaveSize >= .8*stats.maxWaveSize && heavyAmountSpawned <= stats.maxWaveSize * stats.heavyRatio){ + }else if(currWaveSize >= stats.regularBeforeHeavy && heavyAmountSpawned <= stats.maxWaveSize * stats.heavyRatio){ SpawnEnemy(currentSpawner, heavyGladiator); heavyAmountSpawned++; }else{ diff --git a/Assets/Scripts/ArenaStats.cs b/Assets/Scripts/ArenaStats.cs index b3ca5c3..6180e67 100644 --- a/Assets/Scripts/ArenaStats.cs +++ b/Assets/Scripts/ArenaStats.cs @@ -8,6 +8,14 @@ public class ArenaStats : ScriptableObject { [Min(0f)] public int maxWaveSize = 10; [Min(0f), Tooltip("The amount of gladiator to add to wave")] public int waveIncrease = 1; [Min(0f), Tooltip("How many waves before we increase by WaveIncrease")] public int increaseWaveStep = 3; + [Min(0f), Tooltip("Amount of regular before light start spawning")] public int regularBeforeLight = 5; + [Min(0f), Tooltip("Amount of regular before heavy start spawning")] public int regularBeforeHeavy = 8; [Range(0f, 1f), Tooltip("Percentage of gladiator who are light")] public float lightRatio = 0.25f; [Range(0f, 1f), Tooltip("Percentage of gladiator who are heavy")] public float heavyRatio = 0.1f; + + private void Awake() { + if(regularBeforeHeavy > maxWaveSize)regularBeforeHeavy=maxWaveSize; + if(regularBeforeLight > maxWaveSize)regularBeforeLight=maxWaveSize; + + } } \ No newline at end of file