public void ClearCache(VegetationCell vegetationCell) { CompleteCellLoading(); vegetationCell.ClearCache(); ClearBillboardCellsCache(vegetationCell.VegetationCellBounds); OnClearCacheVegetationCellDelegate?.Invoke(this, vegetationCell); }
public void ClearCache(Bounds bounds) { Rect clearRect = RectExtension.CreateRectFromBounds(bounds); CompleteCellLoading(); //TODO Use quadtree here for (int i = LoadedVegetationCellList.Count - 1; i >= 0; i--) { VegetationCell vegetationCell = LoadedVegetationCellList[i]; if (!vegetationCell.Rectangle.Overlaps(clearRect)) { continue; } vegetationCell.ClearCache(); LoadedVegetationCellList.RemoveAtSwapBack(i); OnClearCacheVegetationCellDelegate?.Invoke(this, vegetationCell); } ClearBillboardCellsCache(bounds); }