/// <summary>Called when some tiles in a recast graph have been completely recalculated (e.g from scanning the graph)</summary> public void OnRecalculatedTiles(NavmeshTile[] tiles) { Refresh(); if (handler != null) { handler.OnRecalculatedTiles(tiles); } // If the whole graph was updated then mark all navmesh cuts as being up to date. // If only a part of the graph was updated then a navmesh cut might be over the non-updated part // as well, and in that case we don't want to mark it as fully updated. if (graph.GetTiles().Length == tiles.Length) { DiscardPending(); } }
public TileHandler(NavmeshBase graph) { if (graph == null) { throw new ArgumentNullException("graph"); } if (graph.GetTiles() == null) { Debug.LogWarning("Creating a TileHandler for a graph with no tiles. Please scan the graph before creating a TileHandler"); } this.tileXCount = graph.tileXCount; this.tileZCount = graph.tileZCount; this.activeTileTypes = new TileHandler.TileType[this.tileXCount * this.tileZCount]; this.activeTileRotations = new int[this.activeTileTypes.Length]; this.activeTileOffsets = new int[this.activeTileTypes.Length]; this.reloadedInBatch = new bool[this.activeTileTypes.Length]; this.cuts = new GridLookup <NavmeshClipper>(new Int2(this.tileXCount, this.tileZCount)); this.graph = graph; }