Default implementation of ISpawnExecutor. Pulls instances from a pool, resolves placement via ISpawnLocator, applies the NavMeshPlacementPolicy from SpawnEntry, activates the instance, and updates population tracking.
More...
|
| SpawnExecutor (RuntimeSpawner owner, IPoolAdapter pool, ISpawnLocator locator, PopulationTracker pop) |
| Creates a new executor bound to a spawner, pool adapter, locator, and population tracker.
|
|
GameObject | Spawn (SpawnEntry entry, SpawnContext ctx) |
| Spawns an instance for entry at a position derived from ctx .- Parameters
-
entry | Spawn configuration (prefab, group settings, etc.). |
ctx | Context describing source, placement hints, and player position. |
- Returns
- The spawned instance (active), or
null on failure.
|
|
|
Vector3 | ResolvePosition (SpawnEntry entry, in SpawnContext ctx) |
| Chooses a world position based on the context (group, global, region, wave) and delegates to ISpawnLocator. When a wave point is present, passes SpawnContext.HintTags so the locator can prefer matching hints.
|
|
|
static void | EnsureEnabler (GameObject go, SpawnEntry entry) |
| Ensures a NavMeshReadyEnabler exists and is configured to enable a NavMeshAgent later (used when the policy is NavMeshPlacementPolicy.Prefer).
|
|
Default implementation of ISpawnExecutor. Pulls instances from a pool, resolves placement via ISpawnLocator, applies the NavMeshPlacementPolicy from SpawnEntry, activates the instance, and updates population tracking.
◆ SpawnExecutor()
Creates a new executor bound to a spawner, pool adapter, locator, and population tracker.
- Parameters
-
owner | Owning RuntimeSpawner for deferred placement and events. |
pool | Pool adapter used to fetch/return instances. |
locator | Placement service that finds valid world positions. |
pop | Population tracker that records alive/culled instances. |
◆ EnsureEnabler()
static void MegaCrush.Spawner.SpawnExecutor.EnsureEnabler |
( |
GameObject | go, |
|
|
SpawnEntry | entry ) |
|
staticprivate |
Ensures a NavMeshReadyEnabler exists and is configured to enable a NavMeshAgent later (used when the policy is NavMeshPlacementPolicy.Prefer).
- Parameters
-
go | Spawned GameObject. |
entry | Spawn entry providing NavMesh preferences. |
◆ ResolvePosition()
Chooses a world position based on the context (group, global, region, wave) and delegates to ISpawnLocator. When a wave point is present, passes SpawnContext.HintTags so the locator can prefer matching hints.
- Parameters
-
entry | Spawn settings (may influence grouping behavior). |
ctx | Context describing the source and player position. |
- Returns
- Resolved world position. May be NaN if hint-only refusal is in effect.
◆ Spawn()
Spawns an instance for entry at a position derived from ctx .
- Parameters
-
entry | Spawn configuration (prefab, group settings, etc.). |
ctx | Context describing source, placement hints, and player position. |
- Returns
- The spawned instance (active), or
null
on failure.
Implements MegaCrush.Spawner.ISpawnExecutor.
◆ _locator
◆ _owner
◆ _pool
◆ _pop
The documentation for this class was generated from the following file:
- D:/projects/Asset Store Packages/com.pixelwizards.runtimespawner/Code/Runtime/Internals/SpawnExecutor.cs