public static Vector3?ClosestEmptyCell(this Tilemap tilemap, Vector3 position, Vector3Int[] directions) { return(tilemap.BreadthFirstSearch( position, directions, tilemap.IsCellEmpty, (current, next) => true )); }