Exemple #1
0
        public void OnInspectorGUI()
        {
            EditorGUILayout.Space();

            EditorGUILayout.LabelField("Shape", GUIStyles.GroupTitleStyle);
            {
                EditorGUILayout.PropertyField(resizeFactor, new GUIContent("Resize Factor", "Grow or shrink the mask."));

                EditorGUILayout.PropertyField(randomShape, new GUIContent("Random Shape", "If selected, create the mask as a random shape inside the bounding box. If unselected, use the bounding box as mask."));

                if (randomShape.boolValue)
                {
                    EditorGUILayout.Space();

                    EditorGUILayout.PropertyField(keepOriginalPoints, new GUIContent("Keep Original Points", "Keep the original points in case of a subdivision algorithm."));

                    EditorGUILayout.LabelField(new GUIContent("Convexity", "Relative value to randomly move the shape bounds towards the center, within the original bounds."));
                    EditorGuiUtilities.MinMaxEditor("Min", ref convexityMin, "Max", ref convexityMax, 0f, 1f, true);

                    EditorGUILayout.PropertyField(douglasPeuckerReductionTolerance, new GUIContent("Node Reduction Tolerance", "Douglas Peucker node reduction tolerance. 0 = disabled."));

                    // only values >= 0 allowed
                    douglasPeuckerReductionTolerance.floatValue = Utils.ClipMin(douglasPeuckerReductionTolerance.floatValue, 0f);

                    EditorGUILayout.Space();

                    EditorGUILayout.LabelField(new GUIContent("Polygon Points Count", "The number of points on the polygon."));
                    EditorGuiUtilities.MinMaxEditorInt("Min", ref randomPointsCountMin, "Max", ref randomPointsCountMax, 3, 200, true);
                }
            }
        }
        public void OnInspectorGUI()
        {
            EditorGUILayout.LabelField("Biome Settings", GUIStyles.GroupTitleStyle);
            {
                EditorGUILayout.PropertyField(biomeType, new GUIContent("Biome Type", "The Biome type to be used."));

                EditorGUILayout.LabelField(new GUIContent("Biome Blend Distance", "The relative Biome blend distance. 0 = no blending, 1 = full blending."));
                EditorGuiUtilities.MinMaxEditor("Min", ref biomeBlendDistanceMin, "Max", ref biomeBlendDistanceMax, 0f, 1f, true);

                EditorGUILayout.PropertyField(biomeDensity, new GUIContent("Density", "Reducing density means that some of the partitions aren't used, i. e. they are removed randomly"));
            }
        }
        public void OnInspectorGUI()
        {
            EditorGUILayout.Space();

            EditorGUILayout.LabelField("Partitions", GUIStyles.GroupTitleStyle);

            EditorGUILayout.PropertyField(biomeCount, new GUIContent("Biome Count", "The number of Biomes the terrain should have when full density is selected"));

            // consistency check: never allow the number of partitions to be smaller than 1
            biomeCount.intValue = Utils.ClipMin(biomeCount.intValue, 2);

            EditorGUILayout.PropertyField(partitionStrategy, new GUIContent("Split Strategy", "The strategy to select the terraiin segments which should be partitioned."));

            EditorGUILayout.LabelField(new GUIContent("Partition Shift", "Relative factor to shift and resize the partition bounds within its bounds. Makes the partitions look less rectangularly distributed. Reduces the size."));
            EditorGuiUtilities.MinMaxEditor("Min", ref boundsShiftFactorMin, "Max", ref boundsShiftFactorMax, 0.1f, 1f, true);
        }
        public void OnInspectorGUI()
        {
            EditorGUILayout.Space();

            EditorGUILayout.LabelField("River", GUIStyles.GroupTitleStyle);
#if RAM_2019
            EditorGUILayout.PropertyField(riverCount, new GUIContent("Count", "The number of rivers to add."));

            // keep the count value >= 0
            if (riverCount.intValue < 1)
            {
                riverCount.intValue = 1;
            }

            EditorGUILayout.PropertyField(riverAutomation, new GUIContent("Automation", "Whether to simulate or to generate the rivers"));

            EditorGUILayout.PropertyField(riverSplineProfile, new GUIContent("River Profile", ""));

            EditorGUILayout.LabelField(new GUIContent("Width", ""));
            EditorGuiUtilities.MinMaxEditor("Min", ref riverWidthMin, "Max", ref riverWidthMax, 1, 1000f, true);

            EditorGUILayout.LabelField(new GUIContent("Length", ""));
            EditorGuiUtilities.MinMaxEditor("Min", ref riverSimulatedRiverLengthMin, "Max", ref riverSimulatedRiverLengthMax, 1f, 5000f, true);

            EditorGUILayout.LabelField(new GUIContent("Points Interval", ""));
            EditorGuiUtilities.MinMaxEditorInt("Min", ref riverSimulatedRiverPointsMin, "Max", ref riverSimulatedRiverPointsMax, 1, 100, true);

            EditorGUILayout.LabelField(new GUIContent("Sampling Interval", ""));
            EditorGuiUtilities.MinMaxEditor("Min", ref riverSimulatedMinStepSizeMin, "Max", ref riverSimulatedMinStepSizeMax, 0.5f, 5f, true);

            EditorGUILayout.PropertyField(riverSimulatedNoUp, new GUIContent("Block Uphill", ""));
            EditorGUILayout.PropertyField(riverSimulatedBreakOnUp, new GUIContent("Break Uphill", ""));

            EditorGUILayout.PropertyField(riverNoiseWidth, new GUIContent("Add Width Noise", ""));

            if (riverNoiseWidth.boolValue)
            {
                EditorGUILayout.LabelField(new GUIContent("Noise Multiplier Width", ""));
                EditorGuiUtilities.MinMaxEditor("Min", ref riverNoiseMultiplierWidthMin, "Max", ref riverNoiseMultiplierWidthMax, 1f, 10f, true);

                EditorGUILayout.LabelField(new GUIContent("Noise Scale Width", ""));
                EditorGuiUtilities.MinMaxEditor("Min", ref riverNoiseSizeWidthMin, "Max", ref riverNoiseSizeWidthMax, 0.1f, 50f, true);
            }
#else
            EditorGUILayout.HelpBox("Requires RAM 2019 installed and 'RAM_2019' Scripting Define Symbol", MessageType.Error);
#endif
        }
        public void OnInspectorGUI()
        {
            EditorGUILayout.LabelField("Biome Settings", GUIStyles.GroupTitleStyle);
            {
                // find the popup index, i. e. the filtered index; it isn't necessarily the one of the enum
                int currentPopupIndex = GetCurrentBiomePopupIndex();

                int newIndex = EditorGUILayout.Popup("Biome Type", currentPopupIndex, addedBiomes.GetStrings());

                // map popup index to biome index
                BiomeType newSelectedBiomeType = addedBiomes.GetObjects()[newIndex];
                biomeType.intValue = (int)newSelectedBiomeType;

                EditorGUILayout.LabelField(new GUIContent("Biome Blend Distance", "The relative Biome blend distance. 0 = no blending, 1 = full blending."));
                EditorGuiUtilities.MinMaxEditor("Min", ref biomeBlendDistanceMin, "Max", ref biomeBlendDistanceMax, 0f, 1f, true);

                EditorGUILayout.PropertyField(biomeDensity, new GUIContent("Density", "Reducing density means that some of the partitions aren't used, i. e. they are removed randomly"));
            }
        }
Exemple #6
0
        public void OnInspectorGUI()
        {
            EditorGUILayout.Space();

            EditorGUILayout.LabelField("Lines", GUIStyles.GroupTitleStyle);

            EditorGUILayout.PropertyField(lineCount, new GUIContent("Count", "The number of lines to add."));

            // keep the count value >= 0
            if (lineCount.intValue < 0)
            {
                lineCount.intValue = 0;
            }

            EditorGUILayout.LabelField(new GUIContent("Line Width", "The minimum and maximum line widths"));
            EditorGuiUtilities.MinMaxEditor("Min", ref lineWidthMin, "Max", ref lineWidthMax, 1, 100, true);

            EditorGUILayout.LabelField(new GUIContent("Line Length", "The minimum and maximum line lengths"));
            EditorGuiUtilities.MinMaxEditor("Min", ref lineHeightMin, "Max", ref lineHeightMax, 1, 1000, true);

            EditorGUILayout.LabelField(new GUIContent("Angle", "The rotation angle limits in degrees"));
            EditorGuiUtilities.MinMaxEditor("Min", ref lineAngleMin, "Max", ref lineAngleMax, 0, 360, true);

            EditorGUILayout.PropertyField(lineAttachedToBiome, new GUIContent("Attached to Biome", "The line is attached to the edge of an existing biome or loose on the terrain"));

            if (lineAttachedToBiome.boolValue)
            {
                EditorGUILayout.PropertyField(lineBiomeMaskArea, new GUIContent("Biome Mask", "The Biome used for line attachment."));

                // show error in case the mask doesn't exist
                if (lineBiomeMaskArea.objectReferenceValue == null)
                {
                    EditorGUILayout.HelpBox("The Biome Mask must be defined!", MessageType.Error);
                }

                EditorGUILayout.PropertyField(lineAttachedAngleDelta, new GUIContent("Angle Offset", "The line is normally attached 90 degrees to the biome mask edge. This value allows for some randomness by modifying the angle +/- this value in degrees."));

                EditorGUILayout.PropertyField(lineAttachedAngleFlip, new GUIContent("Inwards", "If active, then the lines will be drawn inwards, into the biome."));
            }
        }