private static void UpdateLastScenes() { string lastScene = EditorSceneManager.GetActiveScene().path; if (string.IsNullOrEmpty(lastScene) == true) { return; } string rawScenes = NGEditorPrefs.GetString(NGScenesWindow.RecentScenesKey, string.Empty, true); if (string.IsNullOrEmpty(rawScenes) == false) { string[] scenes = rawScenes.Split(NGScenesWindow.SceneSeparator); List <string> list = new List <string>(scenes.Length + 1); list.Add(lastScene); for (int i = 0; i < scenes.Length; i++) { if (scenes[i] != lastScene && File.Exists(scenes[i]) == true) { list.Add(scenes[i]); } } NGEditorPrefs.SetString(NGScenesWindow.RecentScenesKey, string.Join(NGScenesWindow.SceneSeparator.ToString(), list.ToArray()), true); } else { NGEditorPrefs.SetString(NGScenesWindow.RecentScenesKey, EditorSceneManager.GetActiveScene().name, true); } }
public void Save() { StringBuilder buffer = Utility.GetBuffer(); for (int i = 0; i < this.usedOutputs.Count; i++) { if (i > 0) { buffer.Append(ExportLogsWindow.UsedOutputsSeparator); } buffer.Append(this.usedOutputs[i].GetType().GetShortAssemblyType()); } NGEditorPrefs.SetString(ExportLogsWindow.UsedOutputsKeyPref, Utility.ReturnBuffer(buffer)); Utility.SaveEditorPref(this, NGEditorPrefs.GetPerProjectPrefix()); for (int i = 0; i < this.exporters.Length; i++) { this.exporters[i].OnDestroy(); } }
private static void SaveHistoric() { if (NGNavSelectionWindow.hasChanged == true) { NGNavSelectionWindow.hasChanged = false; StringBuilder buffer = Utility.GetBuffer(); for (int i = 0; i < NGNavSelectionWindow.historic.Count; ++i) { for (int j = 0; j < NGNavSelectionWindow.historic[i].refs.Count; j++) { Object o = NGNavSelectionWindow.historic[i][j]; if (o != null) { buffer.Append(o.GetInstanceID()); buffer.Append(';'); } } // Should never happens, except if the save is corrupted. if (buffer.Length > 0) { buffer.Length -= 1; buffer.Append(','); } } if (buffer.Length > 0) { buffer.Length -= 1; } NGEditorPrefs.SetString(NGNavSelectionWindow.AutoSavePrefKey, Utility.ReturnBuffer(buffer), true); NGEditorPrefs.SetInt(NGNavSelectionWindow.LastHashPrefKey, NGNavSelectionWindow.lastHash); } }
public override void Save(string path) { NGEditorPrefs.SetString(path, ((Double)this.value).ToString()); }
protected virtual void OnDisable() { NGEditorPrefs.SetBool(SubmissionWindow.AutoPublishKeyPref, this.autoPublish); NGEditorPrefs.SetString(SubmissionWindow.AutoPublishKeyPref + this.assetName, this.comments); }
public override void Save(string path) { NGEditorPrefs.SetString(path, (String)this.value); }