Runtime Spawner 1.0.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.LocalAreaSpawner Class Reference

The local area spawner allows us to weight spawning heavier / lighter when the player enters a given area of the map. Note: does not have it's own API, this is driven by the Runtime Spawner. More...

Inheritance diagram for MegaCrush.Spawner.LocalAreaSpawner:

Public Member Functions

bool IsActiveSpawner ()
 Query if this spawn region is active (has the player in the area)
 
void ShowHide (bool showHide)
 Editor only, draw the volume in the scene view.
 

Properties

BoxCollider ThisCollider [get, set]
 This spawn area is defined by a collider (read only)
 
List< string > RestrictToNavmeshAreas [get, set]
 (optional) restrict spawners in this area to a specific navmesh area
 
List< SpawnEntryCustomRegionSpawners [get, set]
 The list of spawners that should be spawned in this region (read-only)
 
int MaxObjectCount [get]
 Population control: max number of objects we should spawn in this region.
 
int MinObjectCount [get]
 Population control: minimum number of objects we should spawn in this region.
 

Events

static Action< LocalAreaSpawner, bool > onPlayerIsInRegion
 Listen to this event to know when the player enters or leaves this region.
 

Private Member Functions

void OnEnable ()
 
void Start ()
 
void OnTriggerStay (Collider other)
 
void OnTriggerExit (Collider other)
 
RuntimeSpawnerSettings GetSettings ()
 
void OnDrawGizmos ()
 Draw our editor gizmos.
 

Private Attributes

BoxCollider thisCollider
 The collider that defines our local region.
 
List< string > restrictToNavmeshAreas = new()
 Should we restrict spawning to specific navmesh areas?
 
int minObjectCount = 1
 Min object count.
 
int maxObjectCount = 100
 Max object count.
 
List< SpawnEntrycustomRegionSpawners = new()
 The actual spawners that we want to spawn in this region.
 
RuntimeSpawner spawner
 Our parent spawner.
 
bool isActiveSpawner
 is the player within this region
 
string playerTag
 Player tag to look for, set by the runtime spawner.
 
bool showSpawnVolumes = true
 debug / editor only: show the spawn area in the scene view
 
RuntimeSpawnerSettings settings
 

Detailed Description

The local area spawner allows us to weight spawning heavier / lighter when the player enters a given area of the map. Note: does not have it's own API, this is driven by the Runtime Spawner.

Member Function Documentation

◆ GetSettings()

RuntimeSpawnerSettings MegaCrush.Spawner.LocalAreaSpawner.GetSettings ( )
private

◆ IsActiveSpawner()

bool MegaCrush.Spawner.LocalAreaSpawner.IsActiveSpawner ( )

Query if this spawn region is active (has the player in the area)

Returns
true if the player is within the region, false if not

◆ OnDrawGizmos()

void MegaCrush.Spawner.LocalAreaSpawner.OnDrawGizmos ( )
private

Draw our editor gizmos.

◆ OnEnable()

void MegaCrush.Spawner.LocalAreaSpawner.OnEnable ( )
private

◆ OnTriggerExit()

void MegaCrush.Spawner.LocalAreaSpawner.OnTriggerExit ( Collider other)
private

◆ OnTriggerStay()

void MegaCrush.Spawner.LocalAreaSpawner.OnTriggerStay ( Collider other)
private

◆ ShowHide()

void MegaCrush.Spawner.LocalAreaSpawner.ShowHide ( bool showHide)

Editor only, draw the volume in the scene view.

Parameters
showHideTrue to show / false to hide

◆ Start()

void MegaCrush.Spawner.LocalAreaSpawner.Start ( )
private

Member Data Documentation

◆ customRegionSpawners

List<SpawnEntry> MegaCrush.Spawner.LocalAreaSpawner.customRegionSpawners = new()
private

The actual spawners that we want to spawn in this region.

◆ isActiveSpawner

bool MegaCrush.Spawner.LocalAreaSpawner.isActiveSpawner
private

is the player within this region

◆ maxObjectCount

int MegaCrush.Spawner.LocalAreaSpawner.maxObjectCount = 100
private

Max object count.

◆ minObjectCount

int MegaCrush.Spawner.LocalAreaSpawner.minObjectCount = 1
private

Min object count.

◆ playerTag

string MegaCrush.Spawner.LocalAreaSpawner.playerTag
private

Player tag to look for, set by the runtime spawner.

◆ restrictToNavmeshAreas

List<string> MegaCrush.Spawner.LocalAreaSpawner.restrictToNavmeshAreas = new()
private

Should we restrict spawning to specific navmesh areas?

◆ settings

RuntimeSpawnerSettings MegaCrush.Spawner.LocalAreaSpawner.settings
private

◆ showSpawnVolumes

bool MegaCrush.Spawner.LocalAreaSpawner.showSpawnVolumes = true
private

debug / editor only: show the spawn area in the scene view

◆ spawner

RuntimeSpawner MegaCrush.Spawner.LocalAreaSpawner.spawner
private

Our parent spawner.

◆ thisCollider

BoxCollider MegaCrush.Spawner.LocalAreaSpawner.thisCollider
private

The collider that defines our local region.

Property Documentation

◆ CustomRegionSpawners

List<SpawnEntry> MegaCrush.Spawner.LocalAreaSpawner.CustomRegionSpawners
getset

The list of spawners that should be spawned in this region (read-only)

◆ MaxObjectCount

int MegaCrush.Spawner.LocalAreaSpawner.MaxObjectCount
get

Population control: max number of objects we should spawn in this region.

◆ MinObjectCount

int MegaCrush.Spawner.LocalAreaSpawner.MinObjectCount
get

Population control: minimum number of objects we should spawn in this region.

◆ RestrictToNavmeshAreas

List<string> MegaCrush.Spawner.LocalAreaSpawner.RestrictToNavmeshAreas
getset

(optional) restrict spawners in this area to a specific navmesh area

◆ ThisCollider

BoxCollider MegaCrush.Spawner.LocalAreaSpawner.ThisCollider
getset

This spawn area is defined by a collider (read only)

Event Documentation

◆ onPlayerIsInRegion

Action<LocalAreaSpawner, bool> MegaCrush.Spawner.LocalAreaSpawner.onPlayerIsInRegion
static

Listen to this event to know when the player enters or leaves this region.


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