Im trying to get all tile positions on a tilemap that is very big. But when i use the TileMap.HasTile() it has a maximum range for me it doesnt go past it.
void GetAllTiles(Tilemap pTileMap, List<Vector3> pPosList)
{
BoundsInt bounds = pTileMap.cellBounds;
for (int y = bounds.yMin; y <= bounds.yMax; y++)
{
for (int x = bounds.xMin; x <= bounds.xMax; x++)
{
Vector3Int cellPosition = new Vector3Int(x, y, 0);
if (pTileMap.HasTile(cellPosition))
{
Vector3 worldPosition = pTileMap.CellToWorld(cellPosition) + new Vector3(0.5f, 0.5f, 0);
pPosList.Add(worldPosition);
}
}
}
}