예제 #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.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
        }