![]() |
Runtime Spawner 1.2.5
Generic Runtime spawn and instance pooling system for spawning random AI agents around a map. Works with ANY AI system easily.
|
Localized spawn volume that lets the system bias spawning when the player is inside the area. This component does not spawn on its own—it's driven by RuntimeSpawner via region-activation signals. More...
Public Member Functions | |
bool | IsActiveSpawner () |
Returns whether the player is currently inside this region. | |
void | ShowHide (bool showHide) |
Sets whether to draw the region gizmo in the Scene view. | |
Properties | |
BoxCollider | ThisCollider [get, set] |
The collider that defines this region (assigned automatically). | |
List< string > | RestrictToNavmeshAreas [get, set] |
Optional list of NavMesh area names to constrain spawn placement in this region. | |
List< SpawnEntry > | CustomRegionSpawners [get, set] |
Spawner entries that are specific to this region and will be considered when the player is inside. | |
int | MaxObjectCount [get] |
Region-level population cap. | |
int | MinObjectCount [get] |
Region-level minimum population goal. | |
Events | |
static Action< LocalAreaSpawner, bool > | onPlayerIsInRegion |
Raised when the player enters or leaves any LocalAreaSpawner. The bool indicates presence: true on enter, false on exit. | |
Private Member Functions | |
void | OnEnable () |
void | Start () |
void | OnTriggerStay (Collider other) |
void | OnTriggerExit (Collider other) |
RuntimeSpawnerSettings | GetSettings () |
Loads or creates the editor settings for gizmo appearance. | |
void | OnDrawGizmos () |
Draws the region volume as a gizmo in the Scene view. | |
Private Attributes | |
BoxCollider | thisCollider |
The collider that defines our local region. Set/updated automatically. | |
List< string > | restrictToNavmeshAreas = new() |
Optional NavMesh area constraints for this region. | |
int | minObjectCount = 1 |
Minimum number of objects this region should try to maintain when active. | |
int | maxObjectCount = 100 |
Maximum number of objects this region should allow when active. | |
List< SpawnEntry > | customRegionSpawners = new() |
Region-specific spawn entries considered while the player is inside. | |
RuntimeSpawner | spawner |
Owning runtime spawner discovered at startup. | |
bool | isActiveSpawner |
True if the player is currently within this region. | |
string | playerTag |
Player tag to compare against colliders entering the trigger. | |
bool | showSpawnVolumes = true |
Editor-only toggle to show spawn volume gizmos. | |
RuntimeSpawnerSettings | settings |
Localized spawn volume that lets the system bias spawning when the player is inside the area. This component does not spawn on its own—it's driven by RuntimeSpawner via region-activation signals.
Requires a BoxCollider set to Collider.isTrigger.
|
private |
Loads or creates the editor settings for gizmo appearance.
bool MegaCrush.Spawner.LocalAreaSpawner.IsActiveSpawner | ( | ) |
Returns whether the player is currently inside this region.
|
private |
Draws the region volume as a gizmo in the Scene view.
|
private |
|
private |
|
private |
void MegaCrush.Spawner.LocalAreaSpawner.ShowHide | ( | bool | showHide | ) |
Sets whether to draw the region gizmo in the Scene view.
showHide | True to show; false to hide. |
|
private |
|
private |
Region-specific spawn entries considered while the player is inside.
|
private |
True if the player is currently within this region.
|
private |
Maximum number of objects this region should allow when active.
|
private |
Minimum number of objects this region should try to maintain when active.
|
private |
Player tag to compare against colliders entering the trigger.
|
private |
Optional NavMesh area constraints for this region.
|
private |
|
private |
Editor-only toggle to show spawn volume gizmos.
|
private |
Owning runtime spawner discovered at startup.
|
private |
The collider that defines our local region. Set/updated automatically.
|
getset |
Spawner entries that are specific to this region and will be considered when the player is inside.
|
get |
Region-level population cap.
|
get |
Region-level minimum population goal.
|
getset |
Optional list of NavMesh area names to constrain spawn placement in this region.
|
getset |
The collider that defines this region (assigned automatically).
|
static |
Raised when the player enters or leaves any LocalAreaSpawner. The bool
indicates presence: true
on enter, false
on exit.