Exemplo n.º 1
0
        private void AddVisisbleCellsFromCamera(VegetationStudioCamera vegetationStudioCamera)
        {
            JobCullingGroup jobCullingGroup = vegetationStudioCamera.JobCullingGroup;

            if (jobCullingGroup == null)
            {
                return;
            }
            for (int i = 0; i <= jobCullingGroup.VisibleCellIndexList.Length - 1; i++)
            {
                VegetationCell vegetationCell =
                    vegetationStudioCamera.PotentialVisibleCellList[jobCullingGroup.VisibleCellIndexList[i]];

                SelectedVegetationCell selectedVegetationCell = GetSelectorVegetationCell(vegetationCell);

                if (selectedVegetationCell != null)
                {
                    selectedVegetationCell.AddCameraReference(vegetationStudioCamera);
                }
                else
                {
                    selectedVegetationCell = new SelectedVegetationCell(vegetationCell, vegetationStudioCamera);

                    VisibleSelectorVegetationCellList.Add(selectedVegetationCell);
                    OnVegetationCellVisibleDelegate?.Invoke(selectedVegetationCell.VegetationCell);
                }
            }
        }
Exemplo n.º 2
0
        private void RemoveVisisbleCellsFromCamera(VegetationStudioCamera vegetationStudioCamera)
        {
            JobCullingGroup jobCullingGroup = vegetationStudioCamera.JobCullingGroup;

            if (jobCullingGroup == null)
            {
                return;
            }

            for (int j = 0; j <= jobCullingGroup.VisibleCellIndexList.Length - 1; j++)
            {
                VegetationCell vegetationCell =
                    vegetationStudioCamera.PotentialVisibleCellList[jobCullingGroup.VisibleCellIndexList[j]];

                SelectedVegetationCell selectedVegetationCell = GetSelectorVegetationCell(vegetationCell);

                if (selectedVegetationCell == null)
                {
                    continue;
                }

                selectedVegetationCell.RemoveCameraReference(vegetationStudioCamera);
                if (selectedVegetationCell.CameraCount == 0)
                {
                    VisibleSelectorVegetationCellList.Remove(selectedVegetationCell);
                    OnVegetationCellInvisibleDelegate?.Invoke(selectedVegetationCell.VegetationCell);
                }
            }
        }
Exemplo n.º 3
0
        private void OnVegetationCellVisible(VegetationStudioCamera vegetationStudioCamera,
                                             VegetationCell vegetationCell)
        {
            SelectedVegetationCell selectedVegetationCell = GetSelectorVegetationCell(vegetationCell);

            if (selectedVegetationCell != null)
            {
                selectedVegetationCell.AddCameraReference(vegetationStudioCamera);
            }
            else
            {
                selectedVegetationCell = new SelectedVegetationCell(vegetationCell, vegetationStudioCamera);
                VisibleSelectorVegetationCellList.Add(selectedVegetationCell);
                OnVegetationCellVisibleDelegate?.Invoke(selectedVegetationCell.VegetationCell);
            }
        }
Exemplo n.º 4
0
        private void OnVegetationCellInvisible(VegetationStudioCamera vegetationStudioCamera,
                                               VegetationCell vegetationCell)
        {
            SelectedVegetationCell selectedVegetationCell = GetSelectorVegetationCell(vegetationCell);

            if (selectedVegetationCell == null)
            {
                return;
            }

            selectedVegetationCell.RemoveCameraReference(vegetationStudioCamera);
            if (selectedVegetationCell.CameraCount == 0)
            {
                VisibleSelectorVegetationCellList.Remove(selectedVegetationCell);
                OnVegetationCellInvisibleDelegate?.Invoke(selectedVegetationCell.VegetationCell);
            }
        }