public void RestorePreferences() { if (!File.Exists(PreferencesSavePath)) { return; } string PreferencesStr = File.ReadAllText(PreferencesSavePath); Preferences = JsonConvert.DeserializeObject <Lanotalium.PreferencesContainer>(PreferencesStr); if (Preferences.Build < Build) { Preferences.HideWhatsNew = false; Preferences.DoNotRunAsAdmin = false; Preferences.LapInjected = false; if (Build == 44) { EditorManager.ResetEditorLayout(); } } Preferences.Build = Build; if (!File.Exists(EditorLayoutSavePath)) { return; } string EditorLayoutStr = File.ReadAllText(EditorLayoutSavePath); EditorLayout = JsonConvert.DeserializeObject <Lanotalium.Editor.EditorLayout>(EditorLayoutStr); if (EditorManager != null) { EditorManager.RestoreEditorLayout(); } }
private void Start() { #if UNITY_IOS PreferencesSavePath = Application.persistentDataPath + "/Lanotalium/Preferences.json"; AppDataRoaming = Application.persistentDataPath + "/Lanotalium"; #endif if (!Directory.Exists(AppDataRoaming)) { Directory.CreateDirectory(AppDataRoaming); } if (File.Exists(PreferencesSavePath)) { SceneManager.LoadScene(1); return; } else { FirstRunPanel.SetActive(true); Preferences = new Lanotalium.PreferencesContainer(); } }