public void OnEnable() { VegetationStudioInstance = VegetationStudioProUtils.FindVegetationStudioInstance(); extension = (BatchFunctions)target; // biomes biomeType = FindProperty(x => x.biomeType); }
public void OnEnable() { biomeType = editor.FindProperty(x => x.biomeSettings.biomeType); biomeBlendDistanceMin = editor.FindProperty(x => x.biomeSettings.biomeBlendDistanceMin); biomeBlendDistanceMax = editor.FindProperty(x => x.biomeSettings.biomeBlendDistanceMax); biomeDensity = editor.FindProperty(x => x.biomeSettings.density); // get only the added biome types, we don't want all of the enum in the popup addedBiomes = new PopupData <BiomeType>(VegetationStudioProUtils.GetAddedBiomeTypes().ToArray()); }
public void OnEnable() { VegetationStudioInstance = VegetationStudioProUtils.FindVegetationStudioInstance(); extension = (BatchFunctions)target; // biomes modifyAll = FindProperty(x => x.modifyAll); biomeType = FindProperty(x => x.biomeType); // get only the added biome types, we don't want all of the enum in the popup addedBiomes = new PopupData <BiomeType>(VegetationStudioProUtils.GetAddedBiomeTypes().ToArray()); }
public void OnEnable() { this.editor = this; VegetationStudioInstance = VegetationStudioProUtils.FindVegetationStudioInstance(); extension = (BiomeMaskSpawnerExtension)target; #region settings modules rectangularPartitionModule = new RectangularPartitionModule(this); voronoiModule = new VoronoiModule(this); hexagonModule = new HexagonModule(this); lineModule = new LineModule(this); lakeModule = new LakeModule(this); shapeModule = new ShapeModule(this); biomeModule = new BiomeModule(this); processingModule = new ProcessingModule(this); riverModule = new RiverModule(this); roadModule = new RoadModule(this); #endregion settings modules #region action modules maskCreationActionModule = new MaskCreationActionModule(this); roadCreationActionModule = new RoadCreationActionModule(this); vegetationStudioProActionModule = new VegetationStudioProActionModule(this); #endregion action modules #region module OnEnable biomeModule.OnEnable(); lakeModule.OnEnable(); shapeModule.OnEnable(); processingModule.OnEnable(); rectangularPartitionModule.OnEnable(); voronoiModule.OnEnable(); hexagonModule.OnEnable(); lineModule.OnEnable(); riverModule.OnEnable(); roadModule.OnEnable(); #endregion module OnEnable #region Consistency Check performInitialConsistencyCheck = true; #endregion Consistency Check }
public void OnInspectorGUI() { EditorGUILayout.Space(); EditorGUILayout.LabelField("Vegetation Studio Pro", GUIStyles.GroupTitleStyle); GUILayout.BeginHorizontal(); { // create biome mask if (GUILayout.Button("Refresh Vegetation")) { VegetationStudioProUtils.RefreshVegetation(); } } GUILayout.EndHorizontal(); }
/// <summary> /// Iterate through all items of the selected biome /// </summary> /// <param name="selectedBiomeTypes"></param> /// <returns></returns> public int Process(BiomeType[] selectedBiomeTypes) { int itemChangeCount = 0; List <VegetationSystemPro> VegetationSystemList = VegetationStudioInstance.VegetationSystemList; for (int i = 0; i <= VegetationSystemList.Count - 1; i++) { VegetationSystemPro vegetationSystemPro = VegetationSystemList[i]; foreach (VegetationPackagePro vegetationPackagePro in vegetationSystemPro.VegetationPackageProList) { // filter biome type if (!ArrayUtility.Contains(selectedBiomeTypes, vegetationPackagePro.BiomeType)) { continue; } // note: the delete mechanism operates on the list itself => we have to use a clone => using ToArray() on the list foreach (VegetationItemInfoPro vegetationItemInfoPro in vegetationPackagePro.VegetationInfoList.ToArray()) { // perform the actual action OnActionPerformed(vegetationPackagePro, vegetationItemInfoPro); // clear cache vegetationSystemPro.ClearCache(vegetationItemInfoPro.VegetationItemID); itemChangeCount++; } EditorUtility.SetDirty(vegetationPackagePro); } vegetationSystemPro.RefreshVegetationSystem(); VegetationStudioProUtils.SetSceneDirty(vegetationSystemPro); } return(itemChangeCount); }
private void CreateLineMask() { if (editorTarget.dataSource == null) { Debug.LogError("Container isn't set. Please specify a GameObject which contains transforms as children."); return; } List <Vector3> positions = GetPositions(); // closed path: connect last with first position if (closedPath.boolValue && positions.Count > 1) { // add first position as last position positions.Add(positions[0]); } mask.ClearNodes(); mask.AddNodesToEnd(positions.ToArray()); VegetationStudioProUtils.RefreshVegetation(); }
private void ClearLineMask() { mask.ClearNodes(); VegetationStudioProUtils.RefreshVegetation(); }