Default spawn locator that performs physics raycasts and NavMesh sampling to produce valid placement positions for spawned objects.
More...
|
| void | Configure (LayerMask mask, float minSpawnRange, float cullDistance, string[] navmeshAreas) |
| | Configures sampling parameters and NavMesh area mask.- Parameters
-
| 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. |
|
| |
| void | ConfigureHints (bool enabled, SpawnHintSettings settings) |
| | Enables/disables the hint system and supplies settings.- Parameters
-
| enabled | Whether hint lookups should be attempted. |
| settings | Hint parameters asset (cell size, LOS mask, etc.). |
|
| |
| Vector3 | FindForGlobal (Vector3 playerPos, ref Pcg32 rng) |
| | Finds a NavMesh-valid position for global spawning around the player, using the provided RNG for determinism.- Parameters
-
| playerPos | World position of the player. |
| rng | Deterministic RNG used for all sampling inside the method. |
- Returns
- Chosen world position (projected/raycasted as needed).
|
| |
| 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.- Parameters
-
| parentPos | World position of the group parent. |
| playerPos | World position of the player. |
| rng | Deterministic RNG used for all sampling inside the method. |
- Returns
- Chosen world position (projected/raycasted as needed).
|
| |
| Vector3 | FindForRegion (Bounds bounds, float regionHeight, Vector3 playerPos, ref Pcg32 rng) |
| | Finds a NavMesh-valid position inside a region’s bounds, using the provided RNG for determinism.- Parameters
-
| 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. |
- Returns
- Chosen world position (projected/raycasted as needed).
|
| |
| 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.- Parameters
-
| 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. |
- Returns
- Chosen world position (projected/raycasted as needed).
|
| |
| Vector3 | FindForGlobal (Vector3 playerPos) |
| | Finds a NavMesh-valid position for global spawning around the player.- Parameters
-
| playerPos | World position of the player. |
- Returns
- Chosen world position (projected/raycasted as needed).
|
| |
| Vector3 | FindNearParent (Vector3 parentPos, Vector3 playerPos) |
| | Finds a NavMesh-valid position near a group parent (for clustered spawns).- Parameters
-
| parentPos | World position of the group parent. |
| playerPos | World position of the player. |
- Returns
- Chosen world position (projected/raycasted as needed).
|
| |
| Vector3 | FindForRegion (Bounds regionBounds, float regionHeight, Vector3 playerPos) |
| | Finds a NavMesh-valid position inside a region’s bounds.- Parameters
-
| regionBounds | Region world-space AABB. |
| regionHeight | Y height to apply after placement (for visual consistency). |
| playerPos | World position of the player. |
- Returns
- Chosen world position (projected/raycasted as needed).
|
| |
| Vector3 | FindForWave (Transform spawnPoint, float spawnRange, Vector3 playerPos, string[] hintTags=null) |
| | Finds a NavMesh-valid position near a specific wave/special anchor point.- Parameters
-
| spawnPoint | Anchor transform. |
| spawnRange | Radius to sample around the anchor. |
| playerPos | World position of the player. |
| hintTags | Optional tag filter coming from WaveSpawnPoint.AnchorTags. |
- Returns
- Chosen world position (projected/raycasted as needed).
|
| |
|
| bool | TryFromHints (Vector3 center, float searchRadius, Vector3 playerPos, out Vector3 posOut, string[] requestTags=null) |
| | Tries to choose a position from SpawnHintPoint around center . If requestTags is provided, the first pass prefers hints that match at least one tag. If none qualify, a second pass accepts any eligible hint. Returns false if no hint passes checks.
|
| |
| bool | HasPlayerLOS (Vector3 playerPos, Vector3 candidate) |
| | Returns true if there is no blocking collider between player and candidate (i.e., player can see it).
|
| |
| Vector3 | RaycastDown (Vector3 pos) |
| | Raycasts downward to find ground on the configured physics layers. Returns the hit point if found, otherwise the input position.
|
| |
| bool | ValidVsPlayer (Vector3 pos, Vector3 playerPos) |
| | Ensures pos is at least _minRange away from the player.
|
| |
| bool | NavSample (ref Vector3 pos, float maxDist) |
| | Samples the NavMesh near pos restricted to _areaMask. On success, updates pos to the sampled position.
|
| |
| Vector3 | Fallback (Vector3 around) |
| | Best-effort fallback using NavMesh.FindClosestEdge; returns the input position if none found.
|
| |
Default spawn locator that performs physics raycasts and NavMesh sampling to produce valid placement positions for spawned objects.