コード例 #1
0
ファイル: NGScenesWindow.cs プロジェクト: Hengle/clapotis
        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);
            }
        }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
 public override void    Save(string path)
 {
     NGEditorPrefs.SetString(path, ((Double)this.value).ToString());
 }
コード例 #5
0
 protected virtual void  OnDisable()
 {
     NGEditorPrefs.SetBool(SubmissionWindow.AutoPublishKeyPref, this.autoPublish);
     NGEditorPrefs.SetString(SubmissionWindow.AutoPublishKeyPref + this.assetName, this.comments);
 }
コード例 #6
0
 public override void    Save(string path)
 {
     NGEditorPrefs.SetString(path, (String)this.value);
 }