RoomNavMeshManager

Class in ChivalrousGames.DungeonMaster / Inherits from MonoBehaviour

Description

Room nav mesh manager. Uses RoomNavMeshSource and RoomNavMeshLink to create and maintain dynamic NavMesh for a Level.

Fields

currentNavMeshSourcesAmount int The current nav mesh sources amount.
currentNavMeshId int The current nav mesh id.
bakedNavMeshSourcesAmount int The baked nav mesh sources amount.
bakedNavMeshId int The baked nav mesh id.
bakedNavMeshDataList List<NavMeshData> The baked nav mesh data list.
roomNavMeshDataType RoomNavMeshDataType The type of the room nav mesh data.

Properties

Room Room Gets or sets the room.
TrackRoomNavMesh bool Gets or sets a value indicating whether this RoomNavMeshManager tracks room nav mesh. Has an impact on performance. When the system detects changes to the room navmesh sources, it will dynamically rebuild the NavMesh. When rebuilding the NavMesh, associated NavMeshLinks are also refreshed.
TrackedInstances List ReadOnly
Static
Gets the tracked instances. These are the RoomNavMesh that may change during runtime.

Methods

CalculateSourcesId
public int CalculateSourcesId(List sources);
Parameters
sources List<RoomNavMeshSource> Sources.
Return
int The sources id.
Description

Calculates the sources id. Do not call directly unless you know what you are doing. Only the RoomNaveshManagerEditor should call this.

ForceDynamicRebuild
public void ForceDynamicRebuild(bool addTracking);
Parameters
addTracking bool If set to true add tracking. Only works if TrackRoomNavMesh is also true.
Description

Forces a dynamic rebuild of the Room’s NavMesh. This NavMesh will not be added to a cache and will always be dynamic. Use this carefully, since it has an impact on performance.

BuildNavMeshData
public List BuildNavMeshData(String NavMeshPrefix, List sources);
Parameters
NavMeshPrefix string Nav mesh prefix used to name the NavMesh.
sources List<RoomNavMeshSource> Sources.
Return
List The nav mesh data.
Description

Builds the nav mesh data. Do not call directly unless you know what you are doing. Only the RoomNaveshManagerEditor should call this.

DelayedAddRoomNavMesh
public void DelayedAddRoomNavMesh();
Description

Prepares the room nav mesh and adds it to the scene. Will wait one frame before executing.

AddRoomNavMesh
public void AddRoomNavMesh(bool addTracking);
Parameters
addTracking bool If set to true add tracking if room already uses it with TrackRoomNavMesh.
Description

Prepares the room nav mesh and adds it to the scene. There should be no need to call this manually.

RemoveNavMesh
public void RemoveNavMesh(bool removeTracking);
Parameters
removeTracking bool If set to true remove tracking if room already uses it with TrackRoomNavMesh.
Description

Removes the nav mesh. There should be no need to call this manually.

Static Methods

RefreshSourcesForInstance
public static void RefreshSourcesForInstance(RoomNavMeshManager instanceRoomNavMeshManager, bool forceRefresh = false);
Parameters
instanceRoomNavMeshManager RoomNavMeshManager Room nav mesh manager instance.
forceRefresh bool Optional
If set to true force refresh of all sources; otherwise, refreshes only the sources that changed.
Description

Refreshes the Room NavMesh sources for an instance of RoomNavMeshManager.

RefreshSourcesForInstance
public static void RefreshSourcesForInstance(RoomNavMeshManager instanceRoomNavMeshManager, bool forceRefresh = false);
Parameters
instanceRoomNavMeshManager RoomNavMeshManager Room nav mesh manager instance.
instanceSources List<RoomNavMeshSource> Instance sources.
forceRefresh bool Optional
If set to true force refresh of all sources; otherwise, refreshes only the sources that changed.
Description

Refreshes the Room NavMesh sources for an instance of RoomNavMeshManager. More efficient than the other method, use this version if you already have the sources on hand.