/// <summary> /// Write the current state of the wizard window to the settings file. /// </summary> private void SaveSettings() { if (m_Settings == null) { m_Settings = ScriptableObject.CreateInstance <ReproProjectSettings>(); AssetDatabase.CreateAsset(m_Settings, SettingsPath); } m_Settings.ProjectName = m_NewProjectName; m_Settings.ProjectPath = m_NewProjectPath; m_Settings.OpenProject = m_OpenProject; m_Settings.TextureScale = m_TextureScaleFactor; CopyItemsToSettings(ref m_Settings.InputFiles, m_InputItems); CopyItemsToSettings(ref m_Settings.ProjectFiles, m_ProjectItems); EditorUtility.SetDirty(m_Settings); }
/// <summary> /// Reset all parameters to the values stored in the settings file. /// </summary> private void LoadSettings() { if (File.Exists(SettingsPath)) { m_Settings = AssetDatabase.LoadAssetAtPath <ReproProjectSettings>(SettingsPath); m_NewProjectName = m_Settings.ProjectName; m_NewProjectPath = m_Settings.ProjectPath; m_OpenProject = m_Settings.OpenProject; m_TextureScaleFactor = m_Settings.TextureScale; m_TextureScaleIndex = 0; for (int i = 0; i < m_TextureScaleFactors.Length; i++) { if (m_TextureScaleFactor == m_TextureScaleFactors[i]) { m_TextureScaleIndex = i; break; } } CopyItemsFromSettings(m_InputItems, m_Settings.InputFiles); CopyItemsFromSettings(m_ProjectItems, m_Settings.ProjectFiles); } }