Runtime Spawner 1.5.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.NavMeshReadyEnabler Class Referencesealed

Zero-config binder/monitor for NavMeshAgent. More...

Inheritance diagram for MegaCrush.Spawner.NavMeshReadyEnabler:

Static Public Member Functions

static NavMeshReadyEnabler Attach (GameObject go)
 

Private Member Functions

void Awake ()
 
void OnEnable ()
 
void OnDisable ()
 
IEnumerator BindLoop ()
 
IEnumerator MonitorLoop ()
 

Static Private Member Functions

static WaitForSeconds CachedWait (float seconds)
 

Private Attributes

NavMeshAgent agent
 
float searchRadius
 
float horizEpsilon
 
float maxVerticalSnap
 
int areaMask
 
float retryBase
 
float retryMax
 
float monitorInterval
 
WaitForSeconds waitMonitor
 
int tries
 
bool running
 

Static Private Attributes

static readonly WaitForSeconds w0_12 = new WaitForSeconds(0.12f)
 
static readonly WaitForSeconds w0_2 = new WaitForSeconds(0.2f)
 
static readonly WaitForSeconds w0_32 = new WaitForSeconds(0.32f)
 
static readonly WaitForSeconds w0_5 = new WaitForSeconds(0.5f)
 
static readonly WaitForSeconds w0_8 = new WaitForSeconds(0.8f)
 
static readonly WaitForSeconds w1_2 = new WaitForSeconds(1.2f)
 

Detailed Description

Zero-config binder/monitor for NavMeshAgent.

  • Never moves XZ. Only adjusts Y when a triangle exists directly underneath (tiny epsilon).
  • Binds agent when mesh is underfoot, unbinds if mesh disappears (rebake window moves away).
  • Lightweight: cached waits, exponential backoff when off-mesh.

Member Function Documentation

◆ Attach()

static NavMeshReadyEnabler MegaCrush.Spawner.NavMeshReadyEnabler.Attach ( GameObject go)
static

◆ Awake()

void MegaCrush.Spawner.NavMeshReadyEnabler.Awake ( )
private

◆ BindLoop()

IEnumerator MegaCrush.Spawner.NavMeshReadyEnabler.BindLoop ( )
private

◆ CachedWait()

static WaitForSeconds MegaCrush.Spawner.NavMeshReadyEnabler.CachedWait ( float seconds)
staticprivate

◆ MonitorLoop()

IEnumerator MegaCrush.Spawner.NavMeshReadyEnabler.MonitorLoop ( )
private

◆ OnDisable()

void MegaCrush.Spawner.NavMeshReadyEnabler.OnDisable ( )
private

◆ OnEnable()

void MegaCrush.Spawner.NavMeshReadyEnabler.OnEnable ( )
private

Member Data Documentation

◆ agent

NavMeshAgent MegaCrush.Spawner.NavMeshReadyEnabler.agent
private

◆ areaMask

int MegaCrush.Spawner.NavMeshReadyEnabler.areaMask
private

◆ horizEpsilon

float MegaCrush.Spawner.NavMeshReadyEnabler.horizEpsilon
private

◆ maxVerticalSnap

float MegaCrush.Spawner.NavMeshReadyEnabler.maxVerticalSnap
private

◆ monitorInterval

float MegaCrush.Spawner.NavMeshReadyEnabler.monitorInterval
private

◆ retryBase

float MegaCrush.Spawner.NavMeshReadyEnabler.retryBase
private

◆ retryMax

float MegaCrush.Spawner.NavMeshReadyEnabler.retryMax
private

◆ running

bool MegaCrush.Spawner.NavMeshReadyEnabler.running
private

◆ searchRadius

float MegaCrush.Spawner.NavMeshReadyEnabler.searchRadius
private

◆ tries

int MegaCrush.Spawner.NavMeshReadyEnabler.tries
private

◆ w0_12

readonly WaitForSeconds MegaCrush.Spawner.NavMeshReadyEnabler.w0_12 = new WaitForSeconds(0.12f)
staticprivate

◆ w0_2

readonly WaitForSeconds MegaCrush.Spawner.NavMeshReadyEnabler.w0_2 = new WaitForSeconds(0.2f)
staticprivate

◆ w0_32

readonly WaitForSeconds MegaCrush.Spawner.NavMeshReadyEnabler.w0_32 = new WaitForSeconds(0.32f)
staticprivate

◆ w0_5

readonly WaitForSeconds MegaCrush.Spawner.NavMeshReadyEnabler.w0_5 = new WaitForSeconds(0.5f)
staticprivate

◆ w0_8

readonly WaitForSeconds MegaCrush.Spawner.NavMeshReadyEnabler.w0_8 = new WaitForSeconds(0.8f)
staticprivate

◆ w1_2

readonly WaitForSeconds MegaCrush.Spawner.NavMeshReadyEnabler.w1_2 = new WaitForSeconds(1.2f)
staticprivate

◆ waitMonitor

WaitForSeconds MegaCrush.Spawner.NavMeshReadyEnabler.waitMonitor
private

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