SR PerWaveCustom - Smehi/WaveOne GitHub Wiki

With PerWaveCustom you can a lot of freedom with the way you set up your waves. With this spawner you can also make use of the SpawnerPickers that are available.

Properties

Name Description
EnemyWaves List of custom struct which contains the waves.
MinTimeForNextDeployment Minimum time for the next deployment.
MaxTimeForNextDeployment Maximum time for the next deployment.
SpawnRate The rate at which the enemies spawn (enemies per second in editor / seconds per enemy in code).
AutoDeploy Flag to check whether to automatically start the next deployment according to given min and max times.
Parent The transform that the enemies should be put under.
SetEndPoints Flag to check whether to set the end points for the enemies.

Methods

public void StartWave()
public void StartWave(int wave)

Start spawning from where the spawners count or choose a custom wave index you want to spawn (Waves are 0-indexed).


public void SetEndPoint(GameObject prefabGameObject, GameObject instanciatedGameObject, int presetIndex)

Gives the instanciated enemy a script that calculates a path to one of the end points with a preset index so enemies in the same group have the same end point.


public bool IsSpawnerDone()

Returns true if the spawner is done with the wave. If the spawner is between deployments it will still return false.


public bool IsWaveCompleted(int wave)

Returns true if the given wave index has been completed.

Structs

SingleWave

[System.Serializable]
public struct SingleWave
{
    [HideInInspector] public string name;
    public List<EnemyCount> enemies;
    public int deployments;
}

Here name is used only to rename the list element in the inspector. The EnemyWaves property is made out of SingleWaves. Each SingleWave has a list of EnemyCount which contains data for a single enemy. Lastly, you can specify the amount of deployments per wave.


EnemyCount

[System.Serializable]
public struct EnemyCount
{
    [HideInInspector] public string name;
    public GameObject gameObject;
    public int amount;
    public int groupSize;
}

Here name is again used to remane the element in the inspector. the gameObject represents the prefab of the enemy you want to spawn. Amount is the how many of that enemy you want to spawn in total this wave. This amount will be spread over the amount of deployments. Lastly, you can specify what the group size of the enemy will be. If there are enough enemies left it will fill the whole group, otherwise it will just do the enemies that are left over.

⚠️ **GitHub.com Fallback** ⚠️