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); } } }
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); } } }
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); } }
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); } }