Skip to content

Commit 2684091

Browse files
committed
Fix editor prefs
1 parent db24c49 commit 2684091

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

Packages/com.chark.scriptable-scenes/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1414
### Changed
1515

1616
- Menu item order to use `150` instead of `-1000`. This way `CHARK` won't dominate existing entries.
17+
- Editor Prefs will now use project directory name as identifier, this should prevent issues when using Parallel Sync and similar plugins.
1718

1819
### Fixed
1920

Packages/com.chark.scriptable-scenes/Runtime/Utilities/ScriptableSceneUtilities.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Generic;
2+
using System.IO;
23
using System.Linq;
34
using CHARK.ScriptableScenes.Events;
45
using UnityEngine;
@@ -12,8 +13,21 @@ namespace CHARK.ScriptableScenes.Utilities
1213
/// </summary>
1314
internal static class ScriptableSceneUtilities
1415
{
15-
private static readonly string SelectedCollectionKey =
16-
typeof(ScriptableSceneUtilities).FullName + "_" + "Guids";
16+
private static string SelectedCollectionKey
17+
{
18+
get
19+
{
20+
var projectAssetDirPath = Application.dataPath;
21+
var projectDirPath = Path.GetDirectoryName(projectAssetDirPath);
22+
23+
// Project dir is used as id for editor keys, useful when using Parallel sync or similar.
24+
var projectId = string.IsNullOrWhiteSpace(projectAssetDirPath)
25+
? Application.productName
26+
: Path.GetFileName(projectDirPath);
27+
28+
return $"{nameof(ScriptableSceneUtilities)}.{projectId}.SelectedCollection";
29+
}
30+
}
1731

1832
/// <returns>
1933
/// <c>true</c> if scene information is retrieved for <paramref name="obj"/> or

0 commit comments

Comments
 (0)