public void RemoveForeignTrees(List <SpawnerSettings> biomeSpawnerSettings, List <string> validTerrainNames = null) { ProgressBar.Show(ProgressBarPriority.BiomeRemoval, "Removing Foreign Trees", "Removing..."); //Collect the "allowed" tree prefabs in a list, any tree that is not in this list will be affected by the removal operation List <GameObject> domesticTreePrefabs = new List <GameObject>(); //List<TreePrototype> treeProtosToRemove = new List<TreePrototype>(); Terrain currentTerrain = GetCurrentTerrain(); foreach (SpawnerSettings spawnerSettings in biomeSpawnerSettings) { foreach (SpawnRule sr in spawnerSettings.m_spawnerRules) { if (sr.m_resourceType == GaiaConstants.SpawnerResourceType.TerrainTree) { domesticTreePrefabs.Add(spawnerSettings.m_resources.m_treePrototypes[sr.m_resourceIdx].m_desktopPrefab); } } } GaiaMultiTerrainOperation operation = new GaiaMultiTerrainOperation(currentTerrain, transform, m_settings.m_range * 2f, false, validTerrainNames); operation.GetHeightmap(); operation.GetNormalmap(); operation.CollectTerrainDetails(); operation.CollectTerrainTrees(); operation.CollectTerrainGameObjects(); operation.CollectTerrainBakedMasks(); operation.RemoveForeignTrees(ApplyBrush(operation, MultiTerrainOperationType.Tree), domesticTreePrefabs, m_settings.m_removeForeignTreesStrength); ProgressBar.Clear(ProgressBarPriority.BiomeRemoval); operation.CloseOperation(); }