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, IObjectFactory factory, ISpawnLocator locator, PopulationTracker pop) |
| | Creates a new executor bound to a spawner, factory, 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.
|
| |
|
| GameObject | SpawnOne (SpawnEntry entry, ref SpawnContext ctx, GameObject explicitParent) |
| | Spawns a single instance of entry , placed according to ctx and an optional explicitParent . Applies NavMesh placement policy and updates population tracking.
|
| |
| Vector3 | ResolvePositionDet (SpawnEntry entry, ref SpawnContext ctx, GameObject explicitParent) |
| | 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. Uses the deterministic locator overloads with SpawnContext.Rng.
|
| |
|
| static void | EnsureEnabler (GameObject go) |
| | 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, factory, locator, and population tracker.
- Parameters
-
| owner | Owning RuntimeSpawner for deferred placement and events. |
| factory | Factory used to spawn/despawn (offline, PUN, Fusion, etc.). |
| 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 | ) |
|
|
staticprivate |
Ensures a NavMeshReadyEnabler exists and is configured to enable a NavMeshAgent later (used when the policy is NavMeshPlacementPolicy.Prefer).
- Parameters
-
◆ ResolvePositionDet()
| Vector3 MegaCrush.Spawner.SpawnExecutor.ResolvePositionDet |
( |
SpawnEntry | entry, |
|
|
ref SpawnContext | ctx, |
|
|
GameObject | explicitParent ) |
|
private |
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. Uses the deterministic locator overloads with SpawnContext.Rng.
- Parameters
-
| entry | Spawn settings (may influence grouping behavior). |
| ctx | Context describing the source and player position. |
| explicitParent | Optional explicit parent for clustered/group spawns. If provided, placement is computed near this parent. |
- 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.
◆ SpawnOne()
| GameObject MegaCrush.Spawner.SpawnExecutor.SpawnOne |
( |
SpawnEntry | entry, |
|
|
ref SpawnContext | ctx, |
|
|
GameObject | explicitParent ) |
|
private |
Spawns a single instance of entry , placed according to ctx and an optional explicitParent . Applies NavMesh placement policy and updates population tracking.
- Parameters
-
| entry | Spawn configuration (prefab, navmesh policy, etc.). |
| ctx | Context for placement, including deterministic RNG. |
| explicitParent | Optional explicit parent for clustered/group spawns. When provided, placement is computed near this parent. If null, placement uses the standard global/region/wave logic. |
- Returns
- The spawned instance, or
null if placement was refused or deferred.
◆ _factory
◆ _locator
◆ _owner
◆ _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