MF_B_Spawner
A script to automatically spawn units.
Public Variables
initialSpawnAmount : int
Number of units spawned when the scene starts.
unitsPerSpawn : int
Number of units spawned at every spawn interval.
interval : float
Time between spawns.
maxEvents : int
Maximum number of spawns. -1 = unlimited.
spawnPointsGroup : Transform
Group of spawn points each unit can spawn at. Randomly chosen.
randomRadius : float
Units spawns at a random location within radius.
sameHeight : bool
Keeps a spawned unit at the same height of the spawn point, no matter the spawnRandomRadius.
waypointGroups : Transform[]
Groups of waypoints given to each object's navigation script. Randomly chosen if more than one group.
randomWpt : bool
Spawned object begins with MF_AbstractNavigation.randomWpt set to true.
spawnTypes : SpawnType[]
Different unit types to spawn.
Public Class SpawnType
chance : float
Spawn chance. Chance to spawn is the listed chance out of the sum of all listed chances of the group.
Example: If 3 types are listed with chances of [10, 25, 15] The first has a 20% chance to be picked. ( 10 / 50 )
prefab : GameObject
Prefab to be spawned.
objectPool : bool
If true, will use an object pool for these prefabs, as long as AP_Manager is present in the scene. AP_Manager must have a corresponding object pool, or must be set to allow the creation of pools at runtime.
addPool : int
If AP_Manager is set to allowModify, once minPool has been satisfied, addPool object will be added for each spawner reference to the pool.
minPool : int
If AP_Manager is set to allowModify, this is the minimum number of object the pool will have.
A script to automatically spawn units.
Public Variables
initialSpawnAmount : int
Number of units spawned when the scene starts.
unitsPerSpawn : int
Number of units spawned at every spawn interval.
interval : float
Time between spawns.
maxEvents : int
Maximum number of spawns. -1 = unlimited.
spawnPointsGroup : Transform
Group of spawn points each unit can spawn at. Randomly chosen.
randomRadius : float
Units spawns at a random location within radius.
sameHeight : bool
Keeps a spawned unit at the same height of the spawn point, no matter the spawnRandomRadius.
waypointGroups : Transform[]
Groups of waypoints given to each object's navigation script. Randomly chosen if more than one group.
randomWpt : bool
Spawned object begins with MF_AbstractNavigation.randomWpt set to true.
spawnTypes : SpawnType[]
Different unit types to spawn.
Public Class SpawnType
chance : float
Spawn chance. Chance to spawn is the listed chance out of the sum of all listed chances of the group.
Example: If 3 types are listed with chances of [10, 25, 15] The first has a 20% chance to be picked. ( 10 / 50 )
prefab : GameObject
Prefab to be spawned.
objectPool : bool
If true, will use an object pool for these prefabs, as long as AP_Manager is present in the scene. AP_Manager must have a corresponding object pool, or must be set to allow the creation of pools at runtime.
addPool : int
If AP_Manager is set to allowModify, once minPool has been satisfied, addPool object will be added for each spawner reference to the pool.
minPool : int
If AP_Manager is set to allowModify, this is the minimum number of object the pool will have.