Runtime Spawner 1.3.0
Generic Runtime spawn and instance pooling system for spawning random AI agents around a map. Works with ANY AI system easily.
Loading...
Searching...
No Matches
MegaCrush.Spawner.SpawnEntry Class Reference

Defines how a particular prefab can be spawned by the Runtime Spawner. More...

Inheritance diagram for MegaCrush.Spawner.SpawnEntry:

Public Attributes

GameObject prefab
 The prefab to spawn.
 
int maxPopulation = 100
 How many of this object are allowed at one time.
 
int currentPopulation = 0
 Internal counter (not user-editable) of how many are alive.
 
bool useGroupSpawn
 If true, members of this entry spawn in a group relative to the first member.
 
int minGroupSize = 1
 If using group spawns, the minimum group size.
 
int maxGroupSize = 100
 If using group spawns, the maximum group size.
 
NavMeshPlacementPolicy placementPolicy = NavMeshPlacementPolicy.Prefer
 Placement policy for NavMesh-aware spawning:

  • Require – Only place when a NavMesh position is found; otherwise the spawn is deferred and retried.
  • Prefer – Spawn immediately but keep the NavMeshAgent disabled; a helper will enable it once a NavMesh appears nearby.
  • Ignore – Do not project or enforce NavMesh for placement.

 
float navmeshSearchRadius = 2.0f
 Search radius used when projecting to the NavMesh (meters).
 
int navmeshAreaMask = UnityEngine.AI.NavMesh.AllAreas
 NavMesh area mask for placement. Defaults to NavMesh.AllAreas.
 
int navmeshMaxAttempts = 6
 Maximum jittered attempts when searching for a valid NavMesh triangle.
 
float navmeshJitter = 0.75f
 Jitter step size (meters) used while expanding the probe ring during NavMesh projection.
 
int maxDeferredRetries = 8
 Maximum number of deferred retries (Require) or enable polls (Prefer) before giving up. Set to 0 to use a sensible default.
 

Private Member Functions

void OnValidate ()
 

Private Attributes

GameObject instance
 Internal last-spawned instance (not serialized).
 

Detailed Description

Defines how a particular prefab can be spawned by the Runtime Spawner.

Member Function Documentation

◆ OnValidate()

void MegaCrush.Spawner.SpawnEntry.OnValidate ( )
private

Member Data Documentation

◆ currentPopulation

int MegaCrush.Spawner.SpawnEntry.currentPopulation = 0

Internal counter (not user-editable) of how many are alive.

◆ instance

GameObject MegaCrush.Spawner.SpawnEntry.instance
private

Internal last-spawned instance (not serialized).

◆ maxDeferredRetries

int MegaCrush.Spawner.SpawnEntry.maxDeferredRetries = 8

Maximum number of deferred retries (Require) or enable polls (Prefer) before giving up. Set to 0 to use a sensible default.

◆ maxGroupSize

int MegaCrush.Spawner.SpawnEntry.maxGroupSize = 100

If using group spawns, the maximum group size.

◆ maxPopulation

int MegaCrush.Spawner.SpawnEntry.maxPopulation = 100

How many of this object are allowed at one time.

◆ minGroupSize

int MegaCrush.Spawner.SpawnEntry.minGroupSize = 1

If using group spawns, the minimum group size.

◆ navmeshAreaMask

int MegaCrush.Spawner.SpawnEntry.navmeshAreaMask = UnityEngine.AI.NavMesh.AllAreas

NavMesh area mask for placement. Defaults to NavMesh.AllAreas.

◆ navmeshJitter

float MegaCrush.Spawner.SpawnEntry.navmeshJitter = 0.75f

Jitter step size (meters) used while expanding the probe ring during NavMesh projection.

◆ navmeshMaxAttempts

int MegaCrush.Spawner.SpawnEntry.navmeshMaxAttempts = 6

Maximum jittered attempts when searching for a valid NavMesh triangle.

◆ navmeshSearchRadius

float MegaCrush.Spawner.SpawnEntry.navmeshSearchRadius = 2.0f

Search radius used when projecting to the NavMesh (meters).

◆ placementPolicy

NavMeshPlacementPolicy MegaCrush.Spawner.SpawnEntry.placementPolicy = NavMeshPlacementPolicy.Prefer

Placement policy for NavMesh-aware spawning:

  • Require – Only place when a NavMesh position is found; otherwise the spawn is deferred and retried.
  • Prefer – Spawn immediately but keep the NavMeshAgent disabled; a helper will enable it once a NavMesh appears nearby.
  • Ignore – Do not project or enforce NavMesh for placement.

◆ prefab

GameObject MegaCrush.Spawner.SpawnEntry.prefab

The prefab to spawn.

◆ useGroupSpawn

bool MegaCrush.Spawner.SpawnEntry.useGroupSpawn

If true, members of this entry spawn in a group relative to the first member.


The documentation for this class was generated from the following file: