void ClearVegetationItemModels() { for (int i = 0; i <= VegetationStudioCameraList.Count - 1; i++) { if (VegetationStudioCameraList[i].WindSampler) { foreach (Transform child in VegetationStudioCameraList[i].WindSampler.transform) { if (Application.isPlaying) { Destroy(child.gameObject); } else { DestroyImmediate(child.gameObject); } } } } for (int i = 0; i <= VegetationPackageProModelsList.Count - 1; i++) { VegetationPackageProModelsList[i].Dispose(); } VegetationPackageProModelsList.Clear(); }
public void SetupVegetationItemModels() { List <GameObject> windSamplerList = new List <GameObject>(); for (int i = 0; i <= VegetationStudioCameraList.Count - 1; i++) { windSamplerList.Add(VegetationStudioCameraList[i].WindSampler); } ClearVegetationItemModels(); for (int i = 0; i <= VegetationPackageProList.Count - 1; i++) { VegetationPackageProModelInfo vegetationPackageProModelInfo = new VegetationPackageProModelInfo(VegetationPackageProList[i], EnvironmentSettings, windSamplerList, VegetationStudioCameraList.Count); VegetationPackageProModelsList.Add(vegetationPackageProModelInfo); } }
public void SetupVegetationItemModels() { List <GameObject> windSamplerList = new List <GameObject>(); for (int i = 0; i <= VegetationStudioCameraList.Count - 1; i++) { windSamplerList.Add(VegetationStudioCameraList[i].WindSampler); } float additonalBoundingSphereRadius = 0; ClearVegetationItemModels(); for (int i = 0; i <= VegetationPackageProList.Count - 1; i++) { VegetationPackageProModelInfo vegetationPackageProModelInfo = new VegetationPackageProModelInfo(VegetationPackageProList[i], EnvironmentSettings, windSamplerList, VegetationStudioCameraList.Count); VegetationPackageProModelsList.Add(vegetationPackageProModelInfo); additonalBoundingSphereRadius = Mathf.Max(additonalBoundingSphereRadius, vegetationPackageProModelInfo.GetAdditionalBoundingSphereRadius()); } AdditionalBoundingSphereRadius = additonalBoundingSphereRadius; }