|
Runtime Spawner 1.5.0
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 | |
| Vector3 | FindForGlobal (Vector3 playerPos, ref Pcg32 rng) |
| Finds a NavMesh-valid position for global spawning around the player, using the provided RNG for determinism. | |
| Vector3 | FindForRegion (Bounds regionBounds, float regionHeight, Vector3 playerPos, ref Pcg32 rng) |
| Finds a NavMesh-valid position inside a region’s bounds, using the provided RNG for determinism. | |
| Vector3 | FindForWave (Transform anchor, float range, Vector3 playerPos, string[] tags, ref Pcg32 rng) |
| Finds a NavMesh-valid position near a specific wave/special anchor point, using the provided RNG for determinism. | |
| Vector3 | FindNearParent (Vector3 parentPos, Vector3 playerPos, ref Pcg32 rng) |
| Finds a NavMesh-valid position near a group parent (for clustered spawns), using the provided RNG for determinism. | |
| void | Configure (LayerMask mask, float minSpawnRange, float cullDistance, string[] navmeshAreas) |
| Configures sampling parameters and NavMesh area mask. | |
| void | ConfigureHints (bool enabled, SpawnHintSettings settings) |
| Enables/disables the hint system and supplies settings. | |
| 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, string[] hintTags=null) |
| 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.
| void MegaCrush.Spawner.ISpawnLocator.ConfigureHints | ( | bool | enabled, |
| SpawnHintSettings | settings ) |
Enables/disables the hint system and supplies settings.
| enabled | Whether hint lookups should be attempted. |
| settings | Hint parameters asset (cell size, LOS mask, etc.). |
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.FindForGlobal | ( | Vector3 | playerPos, |
| ref Pcg32 | rng ) |
Finds a NavMesh-valid position for global spawning around the player, using the provided RNG for determinism.
| playerPos | World position of the player. |
| rng | Deterministic RNG used for all sampling inside the method. |
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.FindForRegion | ( | Bounds | regionBounds, |
| float | regionHeight, | ||
| Vector3 | playerPos, | ||
| ref Pcg32 | rng ) |
Finds a NavMesh-valid position inside a region’s bounds, using the provided RNG for determinism.
| regionBounds | Region world-space AABB. |
| regionHeight | Y height to apply after placement (for visual consistency). |
| playerPos | World position of the player. |
| rng | Deterministic RNG used for all sampling inside the method. |
Implemented in MegaCrush.Spawner.SpawnLocator.
| Vector3 MegaCrush.Spawner.ISpawnLocator.FindForWave | ( | Transform | anchor, |
| float | range, | ||
| Vector3 | playerPos, | ||
| string[] | tags, | ||
| ref Pcg32 | rng ) |
Finds a NavMesh-valid position near a specific wave/special anchor point, using the provided RNG for determinism.
| anchor | Anchor transform (e.g., a WaveSpawnPoint). |
| range | Radius to sample around the anchor. |
| playerPos | World position of the player. |
| tags | Optional tag filter coming from WaveSpawnPoint.AnchorTags. |
| rng | Deterministic RNG used for all sampling inside the method. |
Implemented in MegaCrush.Spawner.SpawnLocator.
| Vector3 MegaCrush.Spawner.ISpawnLocator.FindForWave | ( | Transform | spawnPoint, |
| float | spawnRange, | ||
| Vector3 | playerPos, | ||
| string[] | hintTags = null ) |
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. |
| hintTags | Optional tag filter coming from WaveSpawnPoint.AnchorTags. |
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.
| Vector3 MegaCrush.Spawner.ISpawnLocator.FindNearParent | ( | Vector3 | parentPos, |
| Vector3 | playerPos, | ||
| ref Pcg32 | rng ) |
Finds a NavMesh-valid position near a group parent (for clustered spawns), using the provided RNG for determinism.
| parentPos | World position of the group parent. |
| playerPos | World position of the player. |
| rng | Deterministic RNG used for all sampling inside the method. |
Implemented in MegaCrush.Spawner.SpawnLocator.