Skip to content

Commit 0da40a3

Browse files
authored
Merge pull request #766 from ropemonkey/fix/uss-asset-path
Use GUID to lookup editor style sheet.
2 parents 435c06d + f278790 commit 0da40a3

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

com.rlabrecque.steamworks.net/Editor/Settings/EditorSteamworksNETSettingsElement.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,24 @@ public sealed class EditorSteamworksNETSettingsElement : VisualElement
66
{
77
private readonly EditorSteamworksNETSettings _settings;
88

9-
private const string UssFilePath =
10-
"Packages/com.rlabrecque.steamworks.net/Editor/Settings/EditorSteamworksNETSettingsStyleSheet.uss";
9+
// This represents the GUID for com.rlabrecque.steamworks.net/Editor/Settings/EditorSteamworksNETSettingsStyleSheet.uss
10+
// If this changes, update this value to match.
11+
private const string UssFileGuid = "fcba6a16ac8056e418e5f791a8bbb67c";
1112

1213
public EditorSteamworksNETSettingsElement()
1314
{
1415
_settings = EditorSteamworksNETSettings.Instance;
15-
var styleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>(UssFilePath);
16-
16+
17+
string ussFilePath = AssetDatabase.GUIDToAssetPath(UssFileGuid);
18+
var styleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>(ussFilePath);
19+
1720
if (styleSheet)
1821
{
1922
styleSheets.Add(styleSheet);
2023
}
2124
else
2225
{
23-
throw new FileNotFoundException($"File not found: {UssFilePath}");
26+
throw new FileNotFoundException($"File not found: {ussFilePath}");
2427
}
2528

2629
var root = new VisualElement();

0 commit comments

Comments
 (0)