1. Home
  2. Docs
  3. NavTile
  4. Scripting
  5. General API

General API

Quick overview of general class structure.

Every tab in the NavTile Settings Window has its own manager which can be accessed using the NavTileManager singleton. The NavTileManager is a scriptable object that is created automatically at Assets > Resources > NavTiles > NavTileManager. Through this singleton, general data and settings can be accessed and changed for each manager.

Surface Manager

By calling NavTileManager.Instance.SurfaceManager you can access all surface related data.

DataHolds all data of the NavTileGrid, see below for more details.
GridThe grid object that NavTile is using for its layout. This can be helpfull to convert world positions to coordinates.
GridInfoHolds almost the same data as the Grid, but it isn’t a Unity class allowing multithreaded operations.
NavTileMapsA list of all tilemaps NavTile is using.
BakeBakes the current scene using a specified pathfinding algorithm.


The data reference in the SurfaceManager holds all the tile data (e.g. which tiles are walkable and which aren’t). Accessing this allows you to get info or dynamically change tiles. This data is stored in a scriptable object inside a resources folder next to its corresponding scene.

TryAddTileAdds a tile area at a position using the index of an area, this index can be retrieved using the AreaManager. Adding the tile fails if the already present area has a higher priority than the new tile area.
OverrideTileAdds a tile area at a position using the index of an area, this index can be retrieved using the AreaManager. This method ignores area priority and overrides any present tile area.
RemoveTileRemoves a tile area on a position, leaving it blank and therefor unwalkable.
RefreshTileRefreshes the tile area at a position, looking at all present tiles at that position and taking the one with the highest priority.
GetTileDataGets the TileData at a position. The data holds the area linked to the tile and possible obstructing agents. If the tile is not present on the NavTileGrid, it will return null.
IsTileWalkableChecks whether a tile at a position is walkable using an areamask which is a bit mask.
ClearTilesClears all tile data of the current scene.
SaveSaves the currently baked data to the scriptable object. This only works in the Unity Editor.
GridBoundsThe total bounds of the NavTileGrid, helpful if you need to loop over all tiles.
TileAmountThe total amount of tiles in the dictionary.
Note: This is a O(N) operation to keep it lock-free. Calling it too often might lead into performance issues.
HasNoTilesChecks if the data is empty in a lock-free operation.
TilesThe TileDictionary itself holding all the tile data.


By calling NavTileManager.Instance.LinkManager you can access all link related data.

GetAllPairsGets all NavLink pairs
ContainsTileLinkChecks if the given tile is linked to a NavLink.
GetLinkedTileGets the NavLink for a tile if present, otherwise, null.
RemoveNavLinkRemoves a NavLink for a specified tile if present.
AddNavLinkAdds a new NavLink for a specified tile.
GetLinkedAreaIndexGets the index of the area linked to the specified tile if present.
RefreshAllNavLinksThis reinitializes all NavLinks using the resources folders, it will not find NavLinks outside these folders.


By calling NavTileManager.Instance.AreaManager you can access all area related data.

GetAreaByIdReturns the NavTileArea corresponding to that index. If the index is outside the bounds (0 – 31), it returns null.
GetAreaIDByNameGives the index of the area with the specified name if present, otherwise, -1 is returned.
GetAreaByNameReturns the NavTileArea with the specified name if present, otherwise, null.
IsDuplicateEntryChecks if the specified area name is already present.
InitializeDefaultNavTileAreasResets all NavTileAreas to the default. Use with caution as this will delete your areas.