Runtime Navmesh Baker 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.RuntimeNavmeshBaker.DataManager Class Referencesealed

Manages NavMeshData and bound NavMeshDataInstance per JobKey. Instances are placed at identity so data-local == world. More...

Public Member Functions

NavMeshData EnsureData (JobKey key, out NavMeshDataInstance instance)
 Ensure a NavMeshData exists for the key and that an instance is bound at identity. If an instance is already valid, it is kept (no remove/rebind churn).
 
void EnsurePlaceholdersForSurface (DynamicNavMeshSurface surface, int[] agentTypeIds)
 Pre-create NavMeshData records for a surface’s agent types without binding instances yet. The service will bind when a bake actually starts.
 
void RemoveAll ()
 Unbind all instances and clear all data.
 
void Remove (JobKey key)
 Remove a specific key (unbind instance if valid).
 
void RemoveForSurface (int surfaceId)
 Remove all keys that belong to a given surface ID.
 

Private Attributes

readonly Dictionary< JobKey, NavMeshData > _dataByKey = new()
 
readonly Dictionary< JobKey, NavMeshDataInstance > _instances = new()
 

Detailed Description

Manages NavMeshData and bound NavMeshDataInstance per JobKey. Instances are placed at identity so data-local == world.

Member Function Documentation

◆ EnsureData()

NavMeshData MegaCrush.RuntimeNavmeshBaker.DataManager.EnsureData ( JobKey key,
out NavMeshDataInstance instance )

Ensure a NavMeshData exists for the key and that an instance is bound at identity. If an instance is already valid, it is kept (no remove/rebind churn).

◆ EnsurePlaceholdersForSurface()

void MegaCrush.RuntimeNavmeshBaker.DataManager.EnsurePlaceholdersForSurface ( DynamicNavMeshSurface surface,
int[] agentTypeIds )

Pre-create NavMeshData records for a surface’s agent types without binding instances yet. The service will bind when a bake actually starts.

◆ Remove()

void MegaCrush.RuntimeNavmeshBaker.DataManager.Remove ( JobKey key)

Remove a specific key (unbind instance if valid).

◆ RemoveAll()

void MegaCrush.RuntimeNavmeshBaker.DataManager.RemoveAll ( )

Unbind all instances and clear all data.

◆ RemoveForSurface()

void MegaCrush.RuntimeNavmeshBaker.DataManager.RemoveForSurface ( int surfaceId)

Remove all keys that belong to a given surface ID.

Member Data Documentation

◆ _dataByKey

readonly Dictionary<JobKey, NavMeshData> MegaCrush.RuntimeNavmeshBaker.DataManager._dataByKey = new()
private

◆ _instances

readonly Dictionary<JobKey, NavMeshDataInstance> MegaCrush.RuntimeNavmeshBaker.DataManager._instances = new()
private

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