private void DrawDensityFunctionChooser()
    {
        EditorGUILayout.LabelField(new GUIContent("Density Function Settings: "), EditorStyles.boldLabel);

        EditorGUIExtensions.Space(2);

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField(new GUIContent("Density Function Apply Mode: "));
        densityFuncApplyMode = (DensityFuncApplyMode)EditorGUILayout.EnumPopup(densityFuncApplyMode);
        EditorGUILayout.EndHorizontal();

        if (densityFuncApplyMode == DensityFuncApplyMode.OneForAll)
        {
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField($"Function: ");
            string buttonString = densityFunctionType != null?densityFunctionType.ToString() : "Chose";

            if (GUILayout.Button(buttonString, EditorStyles.popup))
            {
                Rect r = EditorGUILayout.GetControlRect();
                r.position = Event.current.mousePosition;
                DrawDensityFuncChooser(r);
            }
            EditorGUILayout.EndHorizontal();
        }

        if (GUILayout.Button("Create New Denisty Function"))
        {
            EditorWindow window = GetWindow <FunctionGraphEditor>(typeof(TerrainChunkWindow));
            window.Show();
        }
    }
    private void DrawChunkFormCreator()
    {
        var style = EditorStyles.largeLabel;

        style.fontStyle = FontStyle.Bold;
        EditorGUILayout.LabelField(new GUIContent("Terrain Form:"), style);

        EditorGUIExtensions.Space(2);

        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Edit Chunks"))
        {
            if (EditorUtility.DisplayDialog("Start Editing Chunks", "This is going to open a new scene and close all currently open ones (saving them beforehand). Make sure there are no unwanted changes that would get saved in any open scene.", "Proceed"))
            {
                var sv = GetWindow <ChunkSceneView>(typeof(TerrainChunkWindow));

                sv.Initialize(this);

                sv.SetChunksToManage(chunksToManage);
                sv.Focus();
                sv.Show();

                //Docker.Dock(this, sv, Docker.DockPosition.Bottom);
            }
        }
        EditorGUILayout.EndHorizontal();
    }
    private void DrawWithLayout()
    {
        Rect r = EditorGUILayout.BeginVertical();

        DrawGeneralInfoArea();
        EditorGUIExtensions.Space(5);
        DrawChunkFormCreator();
        EditorGUIExtensions.Space(5);
        DrawFooter();

        EditorGUILayout.BeginVertical();
    }
    private void DrawGeneralInfoArea()
    {
        var style = EditorStyles.largeLabel;

        style.fontStyle = FontStyle.Bold;
        EditorGUILayout.LabelField(new GUIContent("General Settings"), style);

        EditorGUIExtensions.Space(3);

        EditorGUILayout.BeginVertical();

        DrawChunkSettings();

        EditorGUIExtensions.Space(3);

        DrawDensityFunctionChooser();
        DrawChunks();
        EditorGUILayout.EndVertical();
    }