1.3.0: Added EditorProjectPrefs, so each project can have their own settings for history and favorites
This commit is contained in:
parent
65ca5dd355
commit
c54a325cfe
7 changed files with 100 additions and 6 deletions
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Module.NavigationTool.Editor.Utilities;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
|
|
@ -17,7 +18,7 @@ namespace Module.NavigationTool.Editor.Favorite
|
|||
public Favorites()
|
||||
{
|
||||
entries = new List<Entry>();
|
||||
string json = EditorPrefs.GetString(PREF_ID);
|
||||
string json = EditorProjectPrefs.GetString(PREF_ID);
|
||||
|
||||
if (!string.IsNullOrEmpty(json))
|
||||
EditorJsonUtility.FromJsonOverwrite(json, this);
|
||||
|
|
@ -220,7 +221,7 @@ namespace Module.NavigationTool.Editor.Favorite
|
|||
{
|
||||
Sort();
|
||||
string json = EditorJsonUtility.ToJson(this, false);
|
||||
EditorPrefs.SetString(PREF_ID, json);
|
||||
EditorProjectPrefs.SetString(PREF_ID, json);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using Module.NavigationTool.Editor.Utilities;
|
||||
using UnityEditor;
|
||||
|
||||
namespace Module.NavigationTool.Editor.Favorite
|
||||
|
|
@ -39,7 +40,7 @@ namespace Module.NavigationTool.Editor.Favorite
|
|||
public static void DeleteAll()
|
||||
{
|
||||
FAVORITES = null;
|
||||
EditorPrefs.DeleteKey(Favorites.PREF_ID);
|
||||
EditorProjectPrefs.DeleteKey(Favorites.PREF_ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue