/// <summary> /// Saves the current settings. /// </summary> public void Save() { var path = Path.Combine(FileIO.ConfigDirectory, FILE_NAME); if (FileIO.WriteFile(path, SettingSerializer.ToJson(m_categoryToSettings))) { Debug.Log("Saved settings"); } else { Debug.LogError("Failed to saving settings!"); } }
/// <summary> /// Loads the saved settings. /// </summary> public void Load() { var path = Path.Combine(FileIO.ConfigDirectory, FILE_NAME); if (FileIO.ReadFileText(path, out var json)) { SettingSerializer.FromJson(json, m_settings); Debug.Log("Loaded settings"); } else { Debug.LogWarning("Failed to load settings!"); } }