コード例 #1
0
 public void ClearCache(VegetationCell vegetationCell)
 {
     CompleteCellLoading();
     vegetationCell.ClearCache();
     ClearBillboardCellsCache(vegetationCell.VegetationCellBounds);
     OnClearCacheVegetationCellDelegate?.Invoke(this, vegetationCell);
 }
コード例 #2
0
        public void ClearCache(VegetationCell vegetationCell, int vegetationPackageIndex, int vegetationItemIndex)
        {
            CompleteCellLoading();
            VegetationItemInfoPro vegetationItemInfo =
                VegetationPackageProList[vegetationPackageIndex].VegetationInfoList[vegetationItemIndex];
            bool tree = vegetationItemInfo.VegetationType == VegetationType.Tree ||
                        vegetationItemInfo.VegetationType == VegetationType.LargeObjects;

            vegetationCell.ClearCache(vegetationPackageIndex, vegetationItemIndex, tree);
            ClearBillboardCellsCache(vegetationCell.VegetationCellBounds, vegetationPackageIndex, vegetationItemIndex);
            OnClearCacheVegetationCellVegetatonItemDelegate?.Invoke(this, vegetationCell, vegetationPackageIndex, vegetationItemIndex);
        }
コード例 #3
0
        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);
        }