Example #1
0
 /// <summary>
 /// Draws the ErosionTypeWidget
 /// </summary>
 public void DrawErosionTypeProperties()
 {
     EditorWidgetFoldouts["ErosionWidget"] = EditorGUILayout.Foldout(EditorWidgetFoldouts["ErosionWidget"], "ErosionWidget");
     if (EditorWidgetFoldouts["ErosionWidget"])
     {
         GUILayout.Label("Pick an erosion type, try different iter numbers !");
         TerrainInfo.ErosionType = (ErosionGeneration.ErosionType)EditorGUI.EnumPopup(EditorGUILayout.GetControlRect(), TerrainInfo.ErosionType);
         var iters = EditorGUI.IntField(EditorGUILayout.GetControlRect(), "Number of erosion iterations", TerrainInfo.ErosionIterations);
         TerrainInfo.ErosionIterations = iters <= 0 ? 1 : iters;
         TerrainInfo.RuntimeErosion    = EditorGUI.Toggle(EditorGUILayout.GetControlRect(), "Toggle runtime erosion? (will lag)", TerrainInfo.RuntimeErosion);
         if (!TerrainInfo.RuntimeErosion)
         {
             if (GUILayout.Button("Apply erosion!"))
             {
                 Script.ApplyErosion();
             }
         }
     }
     EditorGUILayout.Space();
     EditorGUILayout.Space();
 }