void ShowPresetGUI()
 {
     TerrainToolboxUtilities.DrawSeperatorLine();
     --EditorGUI.indentLevel;
     EditorGUILayout.BeginHorizontal();
     EditorGUILayout.LabelField(Styles.Preset, EditorStyles.boldLabel);
     EditorGUI.BeginChangeCheck();
     m_SelectedPreset = (TerrainCreationSettings)EditorGUILayout.ObjectField(m_SelectedPreset, typeof(TerrainCreationSettings), false);
     if (EditorGUI.EndChangeCheck() && m_SelectedPreset != null)
     {
         if (EditorUtility.DisplayDialog("Confirm", "Load terrain creation settings from selected preset?", "OK", "Cancel"))
         {
             LoadCreationSettings();
         }
     }
     if (GUILayout.Button(Styles.SavePreset))
     {
         UpdateCreationSettings();
         AssetDatabase.SaveAssets();
     }
     if (GUILayout.Button(Styles.SaveAsPreset))
     {
         CreateNewPreset();
     }
     if (GUILayout.Button(Styles.RefreshPreset))
     {
         LoadCreationSettings();
     }
     EditorGUILayout.EndHorizontal();
 }
		void CreateNewPreset()
		{
			string filePath = EditorUtility.SaveFilePanelInProject("Create Terrain Creation Settings", "New Terrain Creation.asset", "asset", "");			
			m_SelectedPreset = ScriptableObject.CreateInstance<TerrainCreationSettings>();
			m_SelectedPreset = m_Settings;
			AssetDatabase.CreateAsset(m_SelectedPreset, filePath);
			AssetDatabase.SaveAssets();
			AssetDatabase.Refresh();
		}
        void CreateNewPreset()
        {
            string filePath = EditorUtility.SaveFilePanelInProject("Create Terrain Creation Settings", "New Terrain Creation.asset", "asset", "");

            if (string.IsNullOrEmpty(filePath))
            {
                return;
            }
            m_SelectedPreset = null;
            var newPreset = ScriptableObject.CreateInstance <TerrainCreationSettings>();

            newPreset = m_Settings;
            AssetDatabase.CreateAsset(newPreset, filePath);
            m_SelectedPreset = newPreset;

            AssetDatabase.SaveAssets();
            AssetDatabase.Refresh();
        }
		public void LoadSettings()
		{
			string filePath = ToolboxHelper.GetPrefFilePath(ToolboxHelper.ToolboxPrefsCreate);
			if (File.Exists(filePath))
			{
				string createSettingsData = File.ReadAllText(filePath);
				JsonUtility.FromJsonOverwrite(createSettingsData, m_Settings);
			}

			if (m_Settings.PresetPath == string.Empty)
			{
				m_SelectedPreset = null;
			}
			else
			{
				m_SelectedPreset = AssetDatabase.LoadAssetAtPath(m_Settings.PresetPath, typeof(TerrainCreationSettings)) as TerrainCreationSettings;
			}
		}