/** Returns a rect containing the indices of all tiles touching the specified bounds.
* \param rect Graph space rectangle (in graph space all tiles are on the XZ plane regardless of graph rotation and other transformations, the first tile has a corner at the origin)
*/
public static IntRect GetTouchingTilesInGraphSpace(this NavmeshBase self, Rect rect)
{
// Calculate world bounds of all affected tiles
var r = new IntRect(Mathf.FloorToInt(rect.xMin / self.TileWorldSizeX), Mathf.FloorToInt(rect.yMin / self.TileWorldSizeZ), Mathf.FloorToInt(rect.xMax / self.TileWorldSizeX), Mathf.FloorToInt(rect.yMax / self.TileWorldSizeZ));
// Clamp to bounds
r = IntRect.Intersection(r, new IntRect(0, 0, self.tileXCount - 1, self.tileZCount - 1));
return(r);
}