![]() |
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.
|
Service that selects world positions for new spawns based on context (global, region, wave, or grouping near a parent) while respecting NavMesh constraints, player distance, and physics ground checks. More...
Public Member Functions | |
void | Configure (LayerMask mask, float minSpawnRange, float cullDistance, string[] navmeshAreas) |
Configures sampling parameters and NavMesh area mask. | |
Vector3 | FindForGlobal (Vector3 playerPos) |
Finds a NavMesh-valid position for global spawning around the player. | |
Vector3 | FindForRegion (Bounds regionBounds, float regionHeight, Vector3 playerPos) |
Finds a NavMesh-valid position inside a region’s bounds. | |
Vector3 | FindForWave (Transform spawnPoint, float spawnRange, Vector3 playerPos) |
Finds a NavMesh-valid position near a specific wave/special anchor point. | |
Vector3 | FindNearParent (Vector3 parentPos, Vector3 playerPos) |
Finds a NavMesh-valid position near a group parent (for clustered spawns). | |
Service that selects world positions for new spawns based on context (global, region, wave, or grouping near a parent) while respecting NavMesh constraints, player distance, and physics ground checks.
void MegaCrush.Spawner.ISpawnLocator.Configure | ( | LayerMask | mask, |
float | minSpawnRange, | ||
float | cullDistance, | ||
string[] | navmeshAreas ) |
Configures sampling parameters and NavMesh area mask.
mask | Physics layers considered as ground when raycasting down. |
minSpawnRange | Minimum allowed distance from the player. |
cullDistance | Max search radius around the player for global placement. |
navmeshAreas | Optional NavMesh area names to restrict placement. |
Implemented in MegaCrush.Spawner.SpawnLocator.
Vector3 MegaCrush.Spawner.ISpawnLocator.FindForGlobal | ( | Vector3 | playerPos | ) |
Finds a NavMesh-valid position for global spawning around the player.
playerPos | World position of the player. |
Implemented in MegaCrush.Spawner.SpawnLocator.
Vector3 MegaCrush.Spawner.ISpawnLocator.FindForRegion | ( | Bounds | regionBounds, |
float | regionHeight, | ||
Vector3 | playerPos ) |
Finds a NavMesh-valid position inside a region’s bounds.
regionBounds | Region world-space AABB. |
regionHeight | Y height to apply after placement (for visual consistency). |
playerPos | World position of the player. |
Implemented in MegaCrush.Spawner.SpawnLocator.
Vector3 MegaCrush.Spawner.ISpawnLocator.FindForWave | ( | Transform | spawnPoint, |
float | spawnRange, | ||
Vector3 | playerPos ) |
Finds a NavMesh-valid position near a specific wave/special anchor point.
spawnPoint | Anchor transform. |
spawnRange | Radius to sample around the anchor. |
playerPos | World position of the player. |
Implemented in MegaCrush.Spawner.SpawnLocator.
Vector3 MegaCrush.Spawner.ISpawnLocator.FindNearParent | ( | Vector3 | parentPos, |
Vector3 | playerPos ) |
Finds a NavMesh-valid position near a group parent (for clustered spawns).
parentPos | World position of the group parent. |
playerPos | World position of the player. |
Implemented in MegaCrush.Spawner.SpawnLocator.