Spawnable Objects - Richardng12/Terra_Tales GitHub Wiki

This interface allows the reuse of the spawner script.

If an object needs to be randomly spawned it implements the AbstractSpawnerObject class.

This class implements the get and set location methods which set the locations for the spawner script (as there are locations in the spawner script).

The spawner script takes a spawn rate as well as a spawn delay field. This sets the time inbetween random spawns for the object needed to be spawned.

The script is also adjustable as you can add as many different objects as well as spawn locations to spawn. The script uses a random number generator to choose both the spawn location and the spawn type and then sets the location of the spawn with the object. By doing this that spawn location is filled and cannot be spawned again until the game object is destroyed.