Beispiel #1
0
        private void DrawExportGUI()
        {
            string label = "Export";
            string id    = "raw-exporter-import";

            GEditorCommon.Foldout(label, true, id, () =>
            {
                if (BulkExport)
                {
                    GUI.enabled = false;
                    GEditorCommon.ActiveTerrainGroupPopupWithAllOption("Group Id", BulkExportGroupId);
                    GUI.enabled = true;
                }
                else
                {
                    GUI.enabled = false;
                    EditorGUILayout.ObjectField("Griffin Data", SrcData, typeof(GTerrainData), false);
                    GUI.enabled = true;
                }
                BitDepth    = (GBitDepth)EditorGUILayout.EnumPopup("Bit Depth", BitDepth);
                string path = DataDirectory;
                GEditorCommon.BrowseFolder("Directory", ref path);
                DataDirectory = path;
                EditorGUILayout.LabelField("Files with the same name will be overwriten!", GEditorCommon.WordWrapItalicLabel);

                if (GUILayout.Button("Export"))
                {
                    GAnalytics.Record(GAnalytics.EXPORT_RAW);
                    Export();
                }
            });
        }
Beispiel #2
0
        private void DrawReArrangeGUI()
        {
            string label = "Re-Arrange";
            string id    = "rearrange" + instance.GetInstanceID();

            GEditorCommon.Foldout(label, false, id, () =>
            {
                string s = string.Format(
                    "This function requires terrain neighboring to be set and the following properties to be overriden:\n" +
                    "   - Width\n" +
                    "   - Length");
                EditorGUILayout.LabelField(s, GEditorCommon.WordWrapItalicLabel);
                GGeometryOverride g = instance.GeometryOverride;
                GUI.enabled         =
                    g.OverrideWidth &&
                    g.OverrideLength;
                if (GUILayout.Button("Re-Arrange"))
                {
                    GAnalytics.Record(GAnalytics.GROUP_REARRANGE);
                    instance.ReArrange();
                    GUtilities.MarkCurrentSceneDirty();
                }

                GUI.enabled = true;
            });
        }
        public static void OnGUI()
        {
            ExtensionName = EditorGUILayout.TextField("Extension Name", ExtensionName);
            PublisherName = EditorGUILayout.TextField("Publisher Name", PublisherName);
            Description   = EditorGUILayout.TextField("Description", Description);
            Version       = EditorGUILayout.TextField("Version", Version);
            string dir = Directory;

            EditorCommon.BrowseFolder("Directory", ref dir);
            if (!string.IsNullOrEmpty(dir))
            {
                Directory = dir;
            }

            GUI.enabled =
                !string.IsNullOrEmpty(ExtensionName) &&
                !string.IsNullOrEmpty(PublisherName) &&
                !string.IsNullOrEmpty(Directory);
            if (GUILayout.Button("Create"))
            {
                GAnalytics.Record(GX_CREATE_EXTENSION_WIZARD);
                CreateScriptFile();
            }
            GUI.enabled = true;
        }
        private void DrawConvertGUI()
        {
            string label = "Convert";
            string id    = "terrain-converter-convert";

            GEditorCommon.Foldout(label, false, id, () =>
            {
                GUI.enabled = false;
                EditorGUILayout.ObjectField("Root", Root, typeof(GameObject), true);
                GUI.enabled = true;

                ImportGeometry = EditorGUILayout.Toggle("Import Geometry", ImportGeometry);
                ImportSplats   = EditorGUILayout.Toggle("Import Splats", ImportSplats);
                if (ImportSplats)
                {
                    EditorGUI.indentLevel += 1;
                    ImportSplatsAsAlbedo   = EditorGUILayout.Toggle("As Albedo", ImportSplatsAsAlbedo);
                    EditorGUI.indentLevel -= 1;
                }

                ImportTrees   = EditorGUILayout.Toggle("Import Trees", ImportTrees);
                ImportGrasses = EditorGUILayout.Toggle("Import Grasses & Details", ImportGrasses);
                string dir    = DataDirectory;
                GEditorCommon.BrowseFolder("Data Directory", ref dir);
                DataDirectory = dir;

                if (GUILayout.Button("Convert"))
                {
                    GAnalytics.Record(GAnalytics.CONVERT_FROM_UNITY_TERRAIN);
                    Convert();
                }
            });
        }
Beispiel #5
0
        private void DrawImportGUI()
        {
            string label = "Import";
            string id    = "texture-importer-import";

            GEditorCommon.Foldout(label, true, id, () =>
            {
                if (BulkImport)
                {
                    GUI.enabled = false;
                    GEditorCommon.ActiveTerrainGroupPopupWithAllOption("Group Id", BulkImportGroupId);
                    GUI.enabled             = true;
                    BulkImportHeightMap     = EditorGUILayout.Toggle("Height Map (R)", BulkImportHeightMap);
                    BulkImportVisibilityMap = EditorGUILayout.Toggle("Visibility Map (1-R)", BulkImportVisibilityMap);
                    BulkImportAlbedoMap     = EditorGUILayout.Toggle("Albedo Map", BulkImportAlbedoMap);
                    BulkImportMetallicMap   = EditorGUILayout.Toggle("Metallic Map", BulkImportMetallicMap);
                    BulkImportControlMaps   = EditorGUILayout.Toggle("Control Maps", BulkImportControlMaps);
                    string dir = Directory;
                    GEditorCommon.BrowseFolder("Directory", ref dir);
                    Directory = dir;

                    string convention =
                        "HeightMap_<optional>_<Polaris Terrain Data Id>\n" +
                        "VisibilityMap_<optional>_<Polaris Terrain Data Id>\n" +
                        "AlbedoMap_<optional>_<Polaris Terrain Data Id>\n" +
                        "MetallicMap_<optional>_<Polaris Terrain Data Id>\n" +
                        "ControlMap<index>_<optional>_<Polaris Terrain Data Id>";
                    EditorGUILayout.LabelField("File Name Convention", convention, GEditorCommon.WordWrapItalicLabel);
                }
                else
                {
                    GUI.enabled = false;
                    EditorGUILayout.ObjectField("Terrain", Terrain, typeof(GStylizedTerrain), true);
                    EditorGUILayout.ObjectField("Griffin Data", DesData, typeof(GTerrainData), false);
                    GUI.enabled = true;

                    HeightMap     = EditorGUILayout.ObjectField("Height Map (R)", HeightMap, typeof(Texture2D), false) as Texture2D;
                    VisibilityMap = EditorGUILayout.ObjectField("Visibility Map (1-R)", VisibilityMap, typeof(Texture2D), false) as Texture2D;
                    AlbedoMap     = EditorGUILayout.ObjectField("Albedo Map", AlbedoMap, typeof(Texture2D), false) as Texture2D;
                    MetallicMap   = EditorGUILayout.ObjectField("Metallic Map", MetallicMap, typeof(Texture2D), false) as Texture2D;

                    if (SplatControlMaps == null || SplatControlMaps.Length != DesData.Shading.SplatControlMapCount)
                    {
                        SplatControlMaps = new Texture2D[DesData.Shading.SplatControlMapCount];
                    }
                    for (int i = 0; i < SplatControlMaps.Length; ++i)
                    {
                        SplatControlMaps[i] = EditorGUILayout.ObjectField("Splat Control " + i, SplatControlMaps[i], typeof(Texture2D), false) as Texture2D;
                    }
                }

                if (GUILayout.Button("Import"))
                {
                    GAnalytics.Record(GAnalytics.IMPORT_TEXTURES);
                    Import();
                }
            });
        }
Beispiel #6
0
        public static void ShowWindow()
        {
            GAnalytics.Record(GAnalytics.HELP_OPEN_WINDOW);
            GHelpEditor window = EditorWindow.GetWindow <GHelpEditor>();

            window.minSize      = new Vector2(300, 300);
            window.titleContent = new GUIContent("Help");
            window.Show();
        }
 private static void DrawCreateWaterGUI()
 {
     if (GUILayout.Button("Add Low Poly Water"))
     {
         GAnalytics.Record(GX_POSEIDON_WATER_QUICK_SETUP);
         InitDefaultConfigs();
         AddWater();
     }
 }
        private void RecordPaintModeAnalytics()
        {
            GObjectPaintingMode mode = painter.Mode;
            string url =
                mode == GObjectPaintingMode.Spawn ? GAnalytics.OPAINTER_SPAWN :
                mode == GObjectPaintingMode.Scale ? GAnalytics.OPAINTER_SCALE :
                mode == GObjectPaintingMode.Custom ? GAnalytics.OPAINTER_CUSTOM : string.Empty;

            GAnalytics.Record(url);
        }
        public override void OnInspectorGUI()
        {
            instance.SplineCreator = EditorGUILayout.ObjectField("Spline Creator", instance.SplineCreator, typeof(GSplineCreator), true) as GSplineCreator;
            if (instance.SplineCreator == null)
            {
                return;
            }
            bool wideMode = EditorGUIUtility.wideMode;

            EditorGUIUtility.wideMode = true;
            EditorGUI.BeginChangeCheck();
            instance.Falloff = EditorGUILayout.CurveField("Falloff", instance.Falloff, Color.red, new Rect(0, 0, 1, 1));
            if (EditorGUI.EndChangeCheck())
            {
                instance.Internal_UpdateFalloffTexture();
            }
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("Falloff Noise");
            instance.FalloffNoise = EditorGUILayout.ObjectField(instance.FalloffNoise, typeof(Texture2D), false) as Texture2D;
            EditorGUILayout.EndHorizontal();
            if (instance.FalloffNoise != null)
            {
                instance.FalloffNoiseSize = EditorGUILayout.Vector2Field("Falloff Noise Size", instance.FalloffNoiseSize);
            }

            instance.MaskResolution = EditorGUILayout.DelayedIntField("Mask Resolution", instance.MaskResolution);

            instance.RemoveTrees = EditorGUILayout.Toggle("Remove Trees", instance.RemoveTrees);
            if (instance.RemoveTrees)
            {
                EditorGUI.indentLevel        += 1;
                instance.TreePrototypeIndices = GEditorCommon.TreeSetMultiSelectionGrid(instance.SplineCreator.GroupId, instance.TreePrototypeIndices);
                EditorGUI.indentLevel        -= 1;
            }

            instance.RemoveGrasses = EditorGUILayout.Toggle("Remove Grasses", instance.RemoveGrasses);
            if (instance.RemoveGrasses)
            {
                EditorGUI.indentLevel         += 1;
                instance.GrassPrototypeIndices = GEditorCommon.GrassSetMultiSelectionGrid(instance.SplineCreator.GroupId, instance.GrassPrototypeIndices);
                EditorGUI.indentLevel         -= 1;
            }

            instance.Editor_ShowLivePreview = EditorGUILayout.Toggle("Live Preview", instance.Editor_ShowLivePreview);
            EditorGUIUtility.wideMode       = wideMode;

            EditorGUILayout.Space();
            if (GUILayout.Button("Apply"))
            {
                GAnalytics.Record(GAnalytics.SPLINE_FOLIAGE_REMOVER);
                CreateInitialBackup();
                Apply();
                CreateBackupAfterApply();
            }
        }
Beispiel #10
0
        private void RecordPaintModeAnalytics()
        {
            GFoliagePaintingMode mode = painter.Mode;
            string url =
                mode == GFoliagePaintingMode.PaintTree ? GAnalytics.FPAINTER_PAINT_TREE :
                mode == GFoliagePaintingMode.ScaleTree ? GAnalytics.FPAINTER_SCALE_TREE :
                mode == GFoliagePaintingMode.PaintGrass ? GAnalytics.FPAINTER_PAINT_GRASS :
                mode == GFoliagePaintingMode.ScaleGrass ? GAnalytics.FPAINTER_SCALE_GRASS :
                mode == GFoliagePaintingMode.Custom ? GAnalytics.FPAINTER_CUSTOM : string.Empty;

            GAnalytics.Record(url);
        }
Beispiel #11
0
 private void ConfirmAndRestoreBackup(string backupName)
 {
     if (EditorUtility.DisplayDialog(
             "Confirm",
             "Restore this Backup?\n" +
             "It's better to save your work before proceeding!",
             "OK", "Cancel"))
     {
         GAnalytics.Record(GAnalytics.BACKUP_RESTORE);
         RestoreBackup(backupName);
     }
 }
        private void DrawActionGUI()
        {
            string label = "Actions";
            string id    = "actions" + instance.GetInstanceID().ToString();

            GEditorCommon.Foldout(label, true, id, () =>
            {
                EditorGUILayout.BeginHorizontal();
                if (GUILayout.Button("Snap To Terrain"))
                {
                    IEnumerator <GStylizedTerrain> terrains = GStylizedTerrain.ActiveTerrains.GetEnumerator();
                    while (terrains.MoveNext())
                    {
                        GStylizedTerrain t = terrains.Current;
                        Bounds b           = t.Bounds;
                        Rect r             = new Rect(new Vector2(b.min.x, b.min.z), new Vector2(b.size.x, b.size.z));
                        Vector2 p          = new Vector2(instance.Position.x, instance.Position.z);
                        if (r.Contains(p))
                        {
                            instance.Position = new Vector3(r.center.x, b.min.y, r.center.y);
                            instance.Rotation = Quaternion.identity;
                            instance.Scale    = new Vector3(b.size.x, b.size.y, b.size.z);
                            break;
                        }
                    }
                }
                if (GUILayout.Button("Snap To Level Bounds"))
                {
                    Bounds b          = GCommon.GetLevelBounds();
                    instance.Position = new Vector3(b.center.x, b.min.y, b.center.z);
                    instance.Rotation = Quaternion.identity;
                    instance.Scale    = new Vector3(b.size.x, b.size.y, b.size.z);
                }
                EditorGUILayout.EndHorizontal();

                if (GUILayout.Button("Clear Objects"))
                {
                    instance.ClearObjects();
                    Event.current.Use();
                }

                if (GUILayout.Button("Apply"))
                {
                    GAnalytics.Record(GAnalytics.STAMPER_OBJECT);
                    ApplyStamp();
                    EditorGUIUtility.ExitGUI();
                }
            });
        }
Beispiel #13
0
        private void DrawMatchEdgeGUI()
        {
            string label = "Match Edge";
            string id    = "match-edge" + instance.GetInstanceID();

            GEditorCommon.Foldout(label, false, id, () =>
            {
                if (GUILayout.Button("Match"))
                {
                    GAnalytics.Record(GAnalytics.GROUP_MATCH_EDGE);
                    GStylizedTerrain.MatchEdges(instance.GroupId);
                    GUtilities.MarkCurrentSceneDirty();
                }
            });
        }
        private void RecordAnalytics()
        {
            GTextureGenerationMode mode = GTextureToolParams.Instance.General.Mode;
            string url =
                mode == GTextureGenerationMode.HeightMap ? GAnalytics.TEXTURE_CREATOR_HEIGHT_MAP :
                mode == GTextureGenerationMode.HeightMapFromMesh ? GAnalytics.TEXTURE_CREATOR_HEIGHT_MAP_FROM_MESH :
                mode == GTextureGenerationMode.NormalMap ? GAnalytics.TEXTURE_CREATOR_NORMAL_MAP :
                mode == GTextureGenerationMode.SteepnessMap ? GAnalytics.TEXTURE_CREATOR_STEEPNESS_MAP :
                mode == GTextureGenerationMode.ColorMap ? GAnalytics.TEXTURE_CREATOR_COLOR_MAP :
                mode == GTextureGenerationMode.NoiseMap ? GAnalytics.TEXTURE_CREATOR_NOISE_MAP :
                mode == GTextureGenerationMode.BlendMap ? GAnalytics.TEXTURE_CREATOR_BLEND_MAP :
                mode == GTextureGenerationMode.FoliageDistributionMap ? GAnalytics.TEXTURE_CREATOR_FOLIAGE_DISTRIBUTION_MAP : string.Empty;

            GAnalytics.Record(url);
        }
Beispiel #15
0
        private void DrawImportGUI()
        {
            string label = "Import";
            string id    = "polarisv1-terrain-importer-import";

            GEditorCommon.Foldout(label, true, id, () =>
            {
                GUI.enabled = false;
                EditorGUILayout.ObjectField("Griffin Data", DesData, typeof(GTerrainData), false);
                GUI.enabled = true;

                SrcData = EditorGUILayout.ObjectField("Polaris V1 Terrain Data", SrcData, typeof(LPTData), true) as LPTData;
                if (SrcData == null)
                {
                    return;
                }

                ImportGeometry = EditorGUILayout.Toggle("Import Geometry", ImportGeometry);
                if (ImportGeometry)
                {
                    EditorGUI.indentLevel  += 1;
                    UsePolarisV1TerrainSize = EditorGUILayout.Toggle("Unity Polaris V1 Size", UsePolarisV1TerrainSize);
                    EditorGUI.indentLevel  -= 1;
                }

                ImportColors = EditorGUILayout.Toggle("Import Colors", ImportColors);
                ImportSplats = EditorGUILayout.Toggle("Import Splats", ImportSplats);
                if (ImportSplats)
                {
                    EditorGUI.indentLevel += 1;
                    if (DesData.Shading.Splats == null ||
                        DesData.Shading.Splats == GGriffinSettings.Instance.TerrainDataDefault.Shading.Splats)
                    {
                        CreateNewSplatPrototypesGroup = true;
                    }
                    GUI.enabled = DesData.Shading.Splats != null && DesData.Shading.Splats != GGriffinSettings.Instance.TerrainDataDefault.Shading.Splats;
                    CreateNewSplatPrototypesGroup = EditorGUILayout.Toggle("New Splats Group", CreateNewSplatPrototypesGroup);
                    GUI.enabled            = true;
                    EditorGUI.indentLevel -= 1;
                }

                if (GUILayout.Button("Import"))
                {
                    GAnalytics.Record(GAnalytics.IMPORT_POLARIS_V1_DATA);
                    Import();
                }
            });
        }
Beispiel #16
0
        public static void OnGUI()
        {
            PFollowSplineConfig config = PFollowSplineConfig.Instance;

            config.Spline     = EditorGUILayout.ObjectField("Spline", config.Spline, typeof(GSplineCreator), true) as GSplineCreator;
            config.Water      = EditorGUILayout.ObjectField("Water", config.Water, typeof(PWater), true) as PWater;
            config.WaterLevel = EditorGUILayout.FloatField("Water Level", config.WaterLevel);
            EditorUtility.SetDirty(config);

            GUI.enabled = config.Spline != null && config.Water != null;
            if (GUILayout.Button("Follow Spline"))
            {
                GAnalytics.Record(GX_POSEIDON_FOLLOW_SPLINE);
                FollowSpline();
            }
            GUI.enabled = true;
        }
Beispiel #17
0
        public override void OnInspectorGUI()
        {
            instance.SplineCreator = EditorGUILayout.ObjectField("Spline Creator", instance.SplineCreator, typeof(GSplineCreator), true) as GSplineCreator;
            if (instance.SplineCreator == null)
            {
                return;
            }
            instance.Channel = (GPathPainter.PaintChannel)EditorGUILayout.EnumPopup("Channel", instance.Channel);
            bool wideMode = EditorGUIUtility.wideMode;

            EditorGUIUtility.wideMode = true;
            EditorGUI.BeginChangeCheck();
            instance.Falloff = EditorGUILayout.CurveField("Falloff", instance.Falloff, Color.red, new Rect(0, 0, 1, 1));
            if (EditorGUI.EndChangeCheck())
            {
                instance.Internal_UpdateFalloffTexture();
            }

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("Falloff Noise");
            instance.FalloffNoise = EditorGUILayout.ObjectField(instance.FalloffNoise, typeof(Texture2D), false) as Texture2D;
            EditorGUILayout.EndHorizontal();
            if (instance.FalloffNoise != null)
            {
                instance.FalloffNoiseSize = EditorGUILayout.Vector2Field("Falloff Noise Size", instance.FalloffNoiseSize);
            }
            EditorGUIUtility.wideMode = wideMode;

            if (instance.Channel == GPathPainter.PaintChannel.AlbedoAndMetallic)
            {
                DrawAlbedoAndMetallicGUI();
            }
            else if (instance.Channel == GPathPainter.PaintChannel.Splat)
            {
                DrawSplatGUI();
            }
            instance.Editor_ShowLivePreview = EditorGUILayout.Toggle("Live Preview", instance.Editor_ShowLivePreview);
            if (GUILayout.Button("Apply"))
            {
                GAnalytics.Record(GAnalytics.SPLINE_PATH_PAINTER);
                CreateInitialBackup();
                ApplyPath();
                CreateBackupAfterApplyPath();
            }
        }
        private void DrawImportGUI()
        {
            string label = "Import";
            string id    = "raw-importer-import";

            GEditorCommon.Foldout(label, true, id, () =>
            {
                if (BulkImport)
                {
                    GUI.enabled = false;
                    GEditorCommon.ActiveTerrainGroupPopupWithAllOption("Group Id", BulkImportGroupId);
                    GUI.enabled = true;
                }
                else
                {
                    GUI.enabled = false;
                    EditorGUILayout.ObjectField("Terrain", Terrain, typeof(GStylizedTerrain), true);
                    EditorGUILayout.ObjectField("Griffin Data", DesData, typeof(GTerrainData), false);
                    GUI.enabled = true;
                }
                BitDepth         = (GBitDepth)EditorGUILayout.EnumPopup("Bit Depth", BitDepth);
                UseRawResolution = EditorGUILayout.Toggle("Use RAW Resolution", UseRawResolution);

                if (BulkImport)
                {
                    string path = DataDirectory;
                    GEditorCommon.BrowseFolder("Directory", ref path);
                    DataDirectory     = path;
                    string convention = string.Format("{0}_{1}_{2}", BitDepth == GBitDepth.Bit8 ? "RAW8" : "RAW16", "<optional>", "< Polaris Terrain Data Id>");
                    EditorGUILayout.LabelField("File Name Convention", convention, GEditorCommon.WordWrapItalicLabel);
                }
                else
                {
                    string path = FilePath;
                    GEditorCommon.BrowseFile("Path", ref path, "raw", "raw", "r16", "r16");
                    FilePath = path;
                }

                if (GUILayout.Button("Import"))
                {
                    GAnalytics.Record(GAnalytics.IMPORT_RAW);
                    Import();
                }
            });
        }
Beispiel #19
0
        private void RecordPaintModeAnalytics()
        {
            GTexturePaintingMode mode = painter.Mode;
            string url =
                mode == GTexturePaintingMode.Elevation ? GAnalytics.TPAINTER_ELEVATION :
                mode == GTexturePaintingMode.HeightSampling ? GAnalytics.TPAINTER_HEIGHT_SAMPLING :
                mode == GTexturePaintingMode.Terrace ? GAnalytics.TPAINTER_TERRACE :
                mode == GTexturePaintingMode.Remap ? GAnalytics.TPAINTER_REMAP :
                mode == GTexturePaintingMode.Noise ? GAnalytics.TPAINTER_NOISE :
                mode == GTexturePaintingMode.SubDivision ? GAnalytics.TPAINTER_SUBDIV :
                mode == GTexturePaintingMode.Albedo ? GAnalytics.TPAINTER_ALBEDO :
                mode == GTexturePaintingMode.Metallic ? GAnalytics.TPAINTER_METALLIC :
                mode == GTexturePaintingMode.Smoothness ? GAnalytics.TPAINTER_SMOOTHNESS :
                mode == GTexturePaintingMode.Splat ? GAnalytics.TPAINTER_SPLAT :
                mode == GTexturePaintingMode.Custom ? GAnalytics.TPAINTER_CUSTOM : string.Empty;

            GAnalytics.Record(url);
        }
        public override void OnInspectorGUI()
        {
            instance.SplineCreator = EditorGUILayout.ObjectField("Spline Creator", instance.SplineCreator, typeof(GSplineCreator), true) as GSplineCreator;
            if (instance.SplineCreator == null)
            {
                return;
            }
            bool wideMode = EditorGUIUtility.wideMode;

            EditorGUIUtility.wideMode = true;
            EditorGUI.BeginChangeCheck();
            instance.Falloff = EditorGUILayout.CurveField("Falloff", instance.Falloff, Color.red, new Rect(0, 0, 1, 1));
            if (EditorGUI.EndChangeCheck())
            {
                instance.Internal_UpdateFalloffTexture();
            }
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("Falloff Noise");
            instance.FalloffNoise = EditorGUILayout.ObjectField(instance.FalloffNoise, typeof(Texture2D), false) as Texture2D;
            EditorGUILayout.EndHorizontal();
            if (instance.FalloffNoise != null)
            {
                instance.FalloffNoiseSize = EditorGUILayout.Vector2Field("Falloff Noise Size", instance.FalloffNoiseSize);
            }

            instance.AdditionalMeshResolution = EditorGUILayout.IntField("Additional Mesh Resolution", instance.AdditionalMeshResolution);
            instance.HeightOffset             = EditorGUILayout.FloatField("Height Offset", instance.HeightOffset);
            instance.StepCount              = EditorGUILayout.IntField("Step Count", instance.StepCount);
            instance.RaiseHeight            = EditorGUILayout.Toggle("Raise Height", instance.RaiseHeight);
            instance.LowerHeight            = EditorGUILayout.Toggle("Lower Height", instance.LowerHeight);
            instance.Editor_ShowLivePreview = EditorGUILayout.Toggle("Live Preview", instance.Editor_ShowLivePreview);
            EditorGUIUtility.wideMode       = wideMode;

            EditorGUILayout.Space();
            if (GUILayout.Button("Apply"))
            {
                GAnalytics.Record(GAnalytics.SPLINE_RAMP_MAKER);
                CreateInitialBackup();
                ApplyRamp();
                CreateBackupAfterApplyRamp();
            }
        }
Beispiel #21
0
        public override void OnInspectorGUI()
        {
            instance.SplineCreator = EditorGUILayout.ObjectField("Spline Creator", instance.SplineCreator, typeof(GSplineCreator), true) as GSplineCreator;
            if (instance.SplineCreator == null)
            {
                return;
            }
            bool wideMode = EditorGUIUtility.wideMode;

            EditorGUIUtility.wideMode = true;
            EditorGUI.BeginChangeCheck();
            instance.Falloff = EditorGUILayout.CurveField("Falloff", instance.Falloff, Color.red, new Rect(0, 0, 1, 1));
            if (EditorGUI.EndChangeCheck())
            {
                instance.Internal_UpdateFalloffTexture();
            }
            instance.FalloffNoise = GEditorCommon.InlineTexture2DField("Falloff Noise", instance.FalloffNoise);
            if (instance.FalloffNoise != null)
            {
                instance.FalloffNoiseSize = EditorGUILayout.Vector2Field("Falloff Noise Size", instance.FalloffNoiseSize);
            }

            instance.MaskResolution = EditorGUILayout.DelayedIntField("Mask Resolution", instance.MaskResolution);

            DrawObjectSelectorGUI();

            instance.Density                = EditorGUILayout.IntField("Density", instance.Density);
            instance.MinRotation            = EditorGUILayout.FloatField("Min Rotation", instance.MinRotation);
            instance.MaxRotation            = EditorGUILayout.FloatField("Max Rotation", instance.MaxRotation);
            instance.MinScale               = GEditorCommon.InlineVector3Field("Min Scale", instance.MinScale);
            instance.MaxScale               = GEditorCommon.InlineVector3Field("Max Scale", instance.MaxScale);
            instance.AlignToSurface         = EditorGUILayout.Toggle("Align To Surface", instance.AlignToSurface);
            instance.Editor_ShowLivePreview = EditorGUILayout.Toggle("Live Preview", instance.Editor_ShowLivePreview);
            EditorGUIUtility.wideMode       = wideMode;

            EditorGUILayout.Space();
            if (GUILayout.Button("Apply"))
            {
                GAnalytics.Record(GAnalytics.SPLINE_OBJECT_SPAWNER);
                Apply();
            }
        }
        private void ConfirmAndImport()
        {
            int selection = EditorUtility.DisplayDialogComplex(
                "Confirm",
                "Grasses and Details storage memory is too large, you may encounter:\n" +
                "- Extremely long time to save project.\n" +
                "- Serialization issues, long or unable to load player.\n" +
                "- System crash.\n" +
                "Consider lowering Grass Density to reduce memory usage!",
                "Continue Anyway", "Cancel", "Fix it for me, please!");

            if (selection == 0) //OK
            {
                GAnalytics.Record(GAnalytics.IMPORT_UNITY_TERRAIN_DATA);
                Import();
            }
            else if (selection == 2) //Alt
            {
                AdjustGrassDensity();
            }
        }
Beispiel #23
0
        public static void OnGUI()
        {
            PainterName = EditorGUILayout.TextField("Painter Name", PainterName);
            PainterType = EditorGUILayout.IntPopup("Type", PainterType, painterTypeLabels, painterTypeValues);
            string dir = Directory;

            EditorCommon.BrowseFolder("Directory", ref dir);
            if (!string.IsNullOrEmpty(dir))
            {
                Directory = dir;
            }

            GUI.enabled =
                !string.IsNullOrEmpty(PainterName) &&
                !string.IsNullOrEmpty(Directory);
            if (GUILayout.Button("Create"))
            {
                GAnalytics.Record(GX_CREATE_CUSTOM_PAINTER_WIZARD);
                CreateScriptFile();
            }
            GUI.enabled = true;
        }
        public static void OnGUI()
        {
            TerrainToFileConfig config = TerrainToFileConfig.Instance;

            config.Terrain = EditorGUILayout.ObjectField("Terrain", config.Terrain, typeof(GStylizedTerrain), true) as GStylizedTerrain;
            int maxLod = 0;

            if (config.Terrain != null && config.Terrain.TerrainData != null)
            {
                maxLod = config.Terrain.TerrainData.Geometry.LODCount;
            }
            List <int>    lodValues = new List <int>();
            List <string> lodLabels = new List <string>();

            for (int i = 0; i < maxLod; ++i)
            {
                lodValues.Add(i);
                lodLabels.Add(i.ToString());
            }
            config.LOD      = EditorGUILayout.IntPopup("LOD", config.LOD, lodLabels.ToArray(), lodValues.ToArray());
            config.FileType = (MeshSaver.FileType)EditorGUILayout.EnumPopup("File Type", config.FileType);
            string dir = config.Directory;

            EditorCommon.BrowseFolder("Directory", ref dir);
            config.Directory = dir;
            EditorUtility.SetDirty(config);

            GUI.enabled =
                config.Terrain != null &&
                config.Terrain.TerrainData != null &&
                !string.IsNullOrEmpty(config.Directory);

            if (GUILayout.Button("Export"))
            {
                GAnalytics.Record(GX_TERRAIN_TO_MESH);
                Export();
            }
            GUI.enabled = true;
        }
Beispiel #25
0
        private void DrawConvertGUI()
        {
            string label = "Convert";
            string id    = "terrain-converter-convert";

            GEditorCommon.Foldout(label, false, id, () =>
            {
                GUI.enabled = false;
                EditorGUILayout.ObjectField("Root", Root, typeof(GameObject), true);
                GUI.enabled = true;

                DataTemplate   = EditorGUILayout.ObjectField("Data Template", DataTemplate, typeof(GTerrainData), false) as GTerrainData;
                ImportGeometry = EditorGUILayout.Toggle("Import Geometry", ImportGeometry);
                ImportSplats   = EditorGUILayout.Toggle("Import Splats", ImportSplats);
                if (ImportSplats)
                {
                    EditorGUI.indentLevel     += 1;
                    ImportSplatsAsAlbedo       = EditorGUILayout.Toggle("As Albedo", ImportSplatsAsAlbedo);
                    bool hasNoTemplateMaterial = DataTemplate == null || DataTemplate.Shading.CustomMaterial == null;
                    if (ImportSplatsAsAlbedo && hasNoTemplateMaterial)
                    {
                        AlbedoUsage = (GAlbedoUsage)EditorGUILayout.EnumPopup("Albedo Usage", AlbedoUsage);
                    }
                    EditorGUI.indentLevel -= 1;
                }

                ImportTrees   = EditorGUILayout.Toggle("Import Trees", ImportTrees);
                ImportGrasses = EditorGUILayout.Toggle("Import Grasses & Details", ImportGrasses);
                string dir    = DataDirectory;
                GEditorCommon.BrowseFolder("Data Directory", ref dir);
                DataDirectory = dir;

                if (GUILayout.Button("Convert"))
                {
                    GAnalytics.Record(GAnalytics.CONVERT_FROM_UNITY_TERRAIN);
                    Convert();
                }
            });
        }
Beispiel #26
0
        public override void OnInspectorGUI()
        {
            instance.SplineCreator = EditorGUILayout.ObjectField("Spline Creator", instance.SplineCreator, typeof(GSplineCreator), true) as GSplineCreator;
            if (instance.SplineCreator == null)
            {
                return;
            }
            bool wideMode = EditorGUIUtility.wideMode;

            EditorGUIUtility.wideMode = true;
            EditorGUI.BeginChangeCheck();
            instance.Falloff = EditorGUILayout.CurveField("Falloff", instance.Falloff, Color.red, new Rect(0, 0, 1, 1));
            if (EditorGUI.EndChangeCheck())
            {
                instance.Internal_UpdateFalloffTexture();
            }
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("Falloff Noise");
            instance.FalloffNoise = EditorGUILayout.ObjectField(instance.FalloffNoise, typeof(Texture2D), false) as Texture2D;
            EditorGUILayout.EndHorizontal();
            if (instance.FalloffNoise != null)
            {
                instance.FalloffNoiseSize = EditorGUILayout.Vector2Field("Falloff Noise Size", instance.FalloffNoiseSize);
            }

            instance.MaskResolution = EditorGUILayout.DelayedIntField("Mask Resolution", instance.MaskResolution);

            DrawObjectSelectorGUI();

            instance.Editor_ShowLivePreview = EditorGUILayout.Toggle("Live Preview", instance.Editor_ShowLivePreview);
            EditorGUIUtility.wideMode       = wideMode;

            EditorGUILayout.Space();
            if (GUILayout.Button("Apply"))
            {
                GAnalytics.Record(GAnalytics.SPLINE_OBJECT_REMOVER);
                Apply();
            }
        }
        private void DrawExportGUI()
        {
            string label = "Export";
            string id    = "texture-exporter-import";

            GEditorCommon.Foldout(label, true, id, () =>
            {
                if (BulkExport)
                {
                    GUI.enabled = false;
                    GEditorCommon.ActiveTerrainGroupPopupWithAllOption("Group Id", BulkExportGroupId);
                    GUI.enabled = true;
                }
                else
                {
                    GUI.enabled = false;
                    EditorGUILayout.ObjectField("Griffin Data", SrcData, typeof(GTerrainData), false);
                    GUI.enabled = true;
                }
                ExportHeightMap          = EditorGUILayout.Toggle("Export Height Map", ExportHeightMap);
                ExportVisibilityMap      = EditorGUILayout.Toggle("Export Visibility Map", ExportVisibilityMap);
                ExportAlbedoMap          = EditorGUILayout.Toggle("Export Albedo Map", ExportAlbedoMap);
                ExportMetallicMap        = EditorGUILayout.Toggle("Export Metallic Map", ExportMetallicMap);
                ExportGradientLookupMaps = EditorGUILayout.Toggle("Export Gradient Maps", ExportGradientLookupMaps);
                ExportSplatControlMaps   = EditorGUILayout.Toggle("Export Splat Control Maps", ExportSplatControlMaps);

                string dir = DataDirectory;
                GEditorCommon.BrowseFolder("Data Directory", ref dir);
                DataDirectory = dir;
                EditorGUILayout.LabelField("Asset with the same name will be overwriten!", GEditorCommon.WordWrapItalicLabel);

                if (GUILayout.Button("Export"))
                {
                    GAnalytics.Record(GAnalytics.EXPORT_TEXTURES);
                    Export();
                }
            });
        }
Beispiel #28
0
        private void DrawCreateBackupGUI()
        {
            string label = "Create";
            string id    = "createbackup";

            GEditorCommon.Foldout(label, false, id, () =>
            {
                float labelWidth            = EditorGUIUtility.labelWidth;
                EditorGUIUtility.labelWidth = 100;

                GroupID     = GEditorCommon.ActiveTerrainGroupPopupWithAllOption("Group Id", GroupID);
                GUI.enabled = !UseAutoName;
                BackupName  = EditorGUILayout.TextField("Name", BackupName);
                GUI.enabled = true;
                UseAutoName = EditorGUILayout.Toggle("Auto Name", UseAutoName);
                if (UseAutoName)
                {
                    BackupName = GBackupFile.GetBackupNameByTimeNow();
                }

                GUI.enabled = !string.IsNullOrEmpty(BackupName);
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.GetControlRect(GUILayout.Width(GEditorCommon.indentSpace));
                Rect r = EditorGUILayout.GetControlRect();
                if (GUI.Button(r, "Create"))
                {
                    GAnalytics.Record(GAnalytics.BACKUP_CREATE);
                    EditorUtility.DisplayProgressBar("Backing Up", "Creating backup files...", 1);
                    GUndoCompatibleBuffer.Instance.RecordUndo();
                    GBackup.Create(BackupName, GroupID);
                    EditorUtility.ClearProgressBar();
                }
                EditorGUILayout.EndHorizontal();
                GUI.enabled = true;

                EditorGUIUtility.labelWidth = labelWidth;
            });
        }
Beispiel #29
0
        private void DrawGeometryOverrideGUI()
        {
            string label = "Geometry Override";
            string id    = "geometryoverride" + instance.GetInstanceID();

            GenericMenu context = new GenericMenu();

            context.AddItem(
                new GUIContent("Default"),
                false,
                () => { instance.ResetGeometry(); });
            context.AddSeparator(null);
            context.AddItem(
                new GUIContent("Reset"),
                false,
                () =>
            {
                if (EditorUtility.DisplayDialog(
                        "Confirm",
                        "Reset geometry data on this terrain group? This action cannot be undone!",
                        "OK", "Cancel"))
                {
                    GCommon.ForEachTerrain(
                        instance.GroupId,
                        (t) =>
                    {
                        if (t.TerrainData == null)
                        {
                            return;
                        }
                        t.TerrainData.Geometry.ResetFull();
                    });
                    GStylizedTerrain.MatchEdges(instance.GroupId);
                }
            });
            context.AddItem(
                new GUIContent("Update"),
                false,
                () =>
            {
                GCommon.ForEachTerrain(
                    instance.GroupId,
                    (t) =>
                {
                    if (t.TerrainData == null)
                    {
                        return;
                    }
                    t.TerrainData.Geometry.SetRegionDirty(GCommon.UnitRect);
                    t.TerrainData.SetDirty(GTerrainData.DirtyFlags.Geometry);
                });
            });
            context.AddItem(
                new GUIContent("Clean Up"),
                false,
                () =>
            {
                GCommon.ForEachTerrain(
                    instance.GroupId,
                    (t) =>
                {
                    if (t.TerrainData == null)
                    {
                        return;
                    }
                    t.TerrainData.Geometry.CleanUp();
                });
            });

            GEditorCommon.Foldout(label, false, id, () =>
            {
                EditorGUILayout.LabelField("Use with cause, this section takes time to process. You may want to use Deferred Update.", GEditorCommon.WordWrapItalicLabel);

                EditorGUI.indentLevel -= 1;
                GGeometryOverride g    = instance.GeometryOverride;
                EditorGUI.BeginChangeCheck();
                float labelWidth            = EditorGUIUtility.labelWidth;
                EditorGUIUtility.labelWidth = labelWidth - TOGGLE_WIDTH;

                EditorGUI.indentLevel += 1;
                GEditorCommon.Header("Dimension");
                EditorGUI.indentLevel -= 1;

                EditorGUILayout.BeginHorizontal();
                g.OverrideWidth = EditorGUILayout.Toggle(g.OverrideWidth, GUILayout.Width(TOGGLE_WIDTH));
                g.Width         = EditorGUILayout.DelayedFloatField("Width", g.Width);
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                g.OverrideHeight = EditorGUILayout.Toggle(g.OverrideHeight, GUILayout.Width(TOGGLE_WIDTH));
                g.Height         = EditorGUILayout.DelayedFloatField("Height", g.Height);
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                g.OverrideLength = EditorGUILayout.Toggle(g.OverrideLength, GUILayout.Width(TOGGLE_WIDTH));
                g.Length         = EditorGUILayout.DelayedFloatField("Length", g.Length);
                EditorGUILayout.EndHorizontal();

                EditorGUI.indentLevel += 1;
                GEditorCommon.Header("Height Map");
                EditorGUI.indentLevel -= 1;

                EditorGUILayout.BeginHorizontal();
                g.OverrideHeightMapResolution = EditorGUILayout.Toggle(g.OverrideHeightMapResolution, GUILayout.Width(TOGGLE_WIDTH));
                g.HeightMapResolution         = EditorGUILayout.DelayedIntField("Height Map Resolution", g.HeightMapResolution);
                EditorGUILayout.EndHorizontal();

                EditorGUI.indentLevel += 1;
                GEditorCommon.Header("Mesh Generation");
                EditorGUI.indentLevel -= 1;

                EditorGUILayout.BeginHorizontal();
                g.OverrideMeshBaseResolution = EditorGUILayout.Toggle(g.OverrideMeshBaseResolution, GUILayout.Width(TOGGLE_WIDTH));
                g.MeshBaseResolution         = EditorGUILayout.DelayedIntField("Mesh Base Resolution", g.MeshBaseResolution);
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                g.OverrideMeshResolution = EditorGUILayout.Toggle(g.OverrideMeshResolution, GUILayout.Width(TOGGLE_WIDTH));
                g.MeshResolution         = EditorGUILayout.DelayedIntField("Mesh Resolution", g.MeshResolution);
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                g.OverrideChunkGridSize = EditorGUILayout.Toggle(g.OverrideChunkGridSize, GUILayout.Width(TOGGLE_WIDTH));
                g.ChunkGridSize         = EditorGUILayout.DelayedIntField("Chunk Grid Size", g.ChunkGridSize);
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                g.OverrideLodCount = EditorGUILayout.Toggle(g.OverrideLodCount, GUILayout.Width(TOGGLE_WIDTH));
                g.LODCount         = EditorGUILayout.DelayedIntField("LOD Count", g.LODCount);
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                g.OverrideDisplacementSeed = EditorGUILayout.Toggle(g.OverrideDisplacementSeed, GUILayout.Width(TOGGLE_WIDTH));
                g.DisplacementSeed         = EditorGUILayout.DelayedIntField("Displacement Seed", g.DisplacementSeed);
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                g.OverrideDisplacementStrength = EditorGUILayout.Toggle(g.OverrideDisplacementStrength, GUILayout.Width(TOGGLE_WIDTH));
                g.DisplacementStrength         = EditorGUILayout.DelayedFloatField("Displacement Strength", g.DisplacementStrength);
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                g.OverrideAlbedoToVertexColorMode = EditorGUILayout.Toggle(g.OverrideAlbedoToVertexColorMode, GUILayout.Width(TOGGLE_WIDTH));
                g.AlbedoToVertexColorMode         = (GAlbedoToVertexColorMode)EditorGUILayout.EnumPopup("Albedo To Vertex Color", g.AlbedoToVertexColorMode);
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                g.OverrideStorageMode = EditorGUILayout.Toggle(g.OverrideStorageMode, GUILayout.Width(TOGGLE_WIDTH));
                g.StorageMode         = (GGeometry.GStorageMode)EditorGUILayout.EnumPopup("Storage", g.StorageMode);
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                g.OverrideAllowTimeSlicedGeneration = EditorGUILayout.Toggle(g.OverrideAllowTimeSlicedGeneration, GUILayout.Width(TOGGLE_WIDTH));
                g.AllowTimeSlicedGeneration         = EditorGUILayout.Toggle("Time Sliced", g.AllowTimeSlicedGeneration);
                EditorGUILayout.EndHorizontal();

                EditorGUIUtility.labelWidth = labelWidth;

                if (EditorGUI.EndChangeCheck())
                {
                    instance.GeometryOverride = g;
                    if (!instance.DeferredUpdate)
                    {
                        GAnalytics.Record(GAnalytics.GROUP_OVERRIDE_GEOMETRY);
                        EditorUtility.DisplayProgressBar("Overriding", "Re-generating terrains geometry", 1);
                        instance.OverrideGeometry();
                        EditorUtility.ClearProgressBar();
                    }
                }
                EditorGUI.indentLevel += 1;
            }, context);
        }
        private void DrawImportGUI()
        {
            string label = "Import";
            string id    = "unity-terrain-importer-import";

            GEditorCommon.Foldout(label, true, id, () =>
            {
                if (BulkImport)
                {
                }
                else
                {
                    GUI.enabled = false;
                    EditorGUILayout.ObjectField("Terrain", DesTerrain, typeof(GStylizedTerrain), true);
                    EditorGUILayout.ObjectField("Griffin Data", DesData, typeof(GTerrainData), false);
                    GUI.enabled = true;

                    EditorGUI.BeginChangeCheck();
                    SrcTerrain = EditorGUILayout.ObjectField("Unity Terrain", SrcTerrain, typeof(Terrain), true) as Terrain;
                    if (SrcTerrain != null)
                    {
                        SrcData = SrcTerrain.terrainData;
                    }

                    GUI.enabled = SrcTerrain == null;
                    SrcData     = EditorGUILayout.ObjectField("Unity Terrain Data", SrcData, typeof(TerrainData), true) as TerrainData;
                    GUI.enabled = true;

                    if (SrcData != null)
                    {
                        if (SrcTerrain != null && SrcTerrain.terrainData != SrcData)
                        {
                            SrcTerrain = null;
                        }
                    }
                    if (EditorGUI.EndChangeCheck())
                    {
                        CalculateEstimatedGrassStorage();
                        AdjustGrassDensity();
                    }

                    if (SrcData == null)
                    {
                        return;
                    }
                }

                ImportGeometry = EditorGUILayout.Toggle("Import Geometry", ImportGeometry);
                if (ImportGeometry)
                {
                    EditorGUI.indentLevel += 1;
                    UseUnityTerrainSize    = EditorGUILayout.Toggle("Unity Terrain Size", UseUnityTerrainSize);
                    EditorGUI.indentLevel -= 1;
                }

                ImportSplats = EditorGUILayout.Toggle("Import Splats", ImportSplats);
                if (ImportSplats)
                {
                    EditorGUI.indentLevel += 1;
                    ImportSplatsAsAlbedo   = EditorGUILayout.Toggle("As Albedo", ImportSplatsAsAlbedo);

                    if (BulkImport)
                    {
                        CreateNewSplatPrototypesGroup = EditorGUILayout.Toggle("New Splats Group", CreateNewSplatPrototypesGroup);
                    }
                    else
                    {
                        if (DesData.Shading.Splats == null ||
                            DesData.Shading.Splats == GGriffinSettings.Instance.TerrainDataDefault.Shading.Splats)
                        {
                            CreateNewSplatPrototypesGroup = true;
                        }
                        GUI.enabled = DesData.Shading.Splats != null && DesData.Shading.Splats != GGriffinSettings.Instance.TerrainDataDefault.Shading.Splats;
                        CreateNewSplatPrototypesGroup = EditorGUILayout.Toggle("New Splats Group", CreateNewSplatPrototypesGroup);
                        GUI.enabled = true;
                    }
                    EditorGUI.indentLevel -= 1;
                }

                ImportTrees = EditorGUILayout.Toggle("Import Trees", ImportTrees);
                if (ImportTrees)
                {
                    EditorGUI.indentLevel += 1;

                    if (BulkImport)
                    {
                        CreateNewTreePrototypesGroup = EditorGUILayout.Toggle("New Trees Group", CreateNewTreePrototypesGroup);
                    }
                    else
                    {
                        if (DesData.Foliage.Trees == null ||
                            DesData.Foliage.Trees == GGriffinSettings.Instance.TerrainDataDefault.Foliage.Trees)
                        {
                            CreateNewTreePrototypesGroup = true;
                        }
                        GUI.enabled = DesData.Foliage.Trees != null && DesData.Foliage.Trees != GGriffinSettings.Instance.TerrainDataDefault.Foliage.Trees;
                        CreateNewTreePrototypesGroup = EditorGUILayout.Toggle("New Trees Group", CreateNewTreePrototypesGroup);
                        GUI.enabled = true;
                    }
                    EditorGUI.indentLevel -= 1;
                }

                ImportGrasses = EditorGUILayout.Toggle("Import Grasses & Details", ImportGrasses);
                if (ImportGrasses)
                {
                    EditorGUI.indentLevel += 1;

                    if (BulkImport)
                    {
                        CreateNewGrassPrototypesGroup = EditorGUILayout.Toggle("New Grasses Group", CreateNewGrassPrototypesGroup);
                    }
                    else
                    {
                        if (DesData.Foliage.Grasses == null ||
                            DesData.Foliage.Grasses == GGriffinSettings.Instance.TerrainDataDefault.Foliage.Grasses)
                        {
                            CreateNewGrassPrototypesGroup = true;
                        }
                        GUI.enabled = DesData.Foliage.Grasses != null && DesData.Foliage.Grasses != GGriffinSettings.Instance.TerrainDataDefault.Foliage.Grasses;
                        CreateNewGrassPrototypesGroup = EditorGUILayout.Toggle("New Grasses Group", CreateNewGrassPrototypesGroup);
                        GUI.enabled = true;
                        EditorGUI.BeginChangeCheck();
                        GrassDensity = EditorGUILayout.Slider("Density", GrassDensity, 0f, 1f);
                        if (EditorGUI.EndChangeCheck())
                        {
                            CalculateEstimatedGrassStorage();
                        }
                        GUI.enabled         = false;
                        string storageLabel = string.Format(
                            "{0} MB",
                            (estimatedGrassStorage / 1000000f).ToString("0.00"));
                        if (estimatedGrassStorage > 1000000000)
                        {
                            float gb      = estimatedGrassStorage / 1000000000f;
                            storageLabel += " = " + gb.ToString("0.00") + " GB";
                        }

                        if (estimatedGrassStorage > 100 * 1000000)
                        {
                            storageLabel = string.Format("<color=red>{0}</color>", storageLabel);
                        }

                        EditorGUILayout.LabelField("Estimated Storage", storageLabel, GEditorCommon.RichTextLabel);
                        GUI.enabled = true;
                    }
                    EditorGUI.indentLevel -= 1;
                }

                if (BulkImport)
                {
                    string dir = Directory;
                    GEditorCommon.BrowseFolder("Directory", ref dir);
                    Directory = dir;

                    EditorGUILayout.LabelField("File Name Convention", "TerrainData_<Polaris Terrain Data Id>", GEditorCommon.WordWrapItalicLabel);
                }

                if (GUILayout.Button("Import"))
                {
                    if (!BulkImport && ImportGrasses && estimatedGrassStorage > 100 * 1000000)
                    {
                        ConfirmAndImport();
                    }
                    else
                    {
                        GAnalytics.Record(GAnalytics.IMPORT_UNITY_TERRAIN_DATA);
                        Import();
                    }
                }
            });
        }