From f2787900e21cfb2375413c83c978657d64e3e3cd Mon Sep 17 00:00:00 2001 From: Mike Baldwin <7369476+ropemonkey@users.noreply.github.com> Date: Wed, 10 Dec 2025 22:46:04 -0800 Subject: [PATCH] Use GUID to lookup editor settings style sheet. This works if Steamworks.NET is installed from git or a unity package file --- .../Settings/EditorSteamworksNETSettingsElement.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/com.rlabrecque.steamworks.net/Editor/Settings/EditorSteamworksNETSettingsElement.cs b/com.rlabrecque.steamworks.net/Editor/Settings/EditorSteamworksNETSettingsElement.cs index 0d638fa4..054889e0 100644 --- a/com.rlabrecque.steamworks.net/Editor/Settings/EditorSteamworksNETSettingsElement.cs +++ b/com.rlabrecque.steamworks.net/Editor/Settings/EditorSteamworksNETSettingsElement.cs @@ -6,21 +6,24 @@ public sealed class EditorSteamworksNETSettingsElement : VisualElement { private readonly EditorSteamworksNETSettings _settings; - private const string UssFilePath = - "Packages/com.rlabrecque.steamworks.net/Editor/Settings/EditorSteamworksNETSettingsStyleSheet.uss"; + // This represents the GUID for com.rlabrecque.steamworks.net/Editor/Settings/EditorSteamworksNETSettingsStyleSheet.uss + // If this changes, update this value to match. + private const string UssFileGuid = "fcba6a16ac8056e418e5f791a8bbb67c"; public EditorSteamworksNETSettingsElement() { _settings = EditorSteamworksNETSettings.Instance; - var styleSheet = AssetDatabase.LoadAssetAtPath(UssFilePath); - + + string ussFilePath = AssetDatabase.GUIDToAssetPath(UssFileGuid); + var styleSheet = AssetDatabase.LoadAssetAtPath(ussFilePath); + if (styleSheet) { styleSheets.Add(styleSheet); } else { - throw new FileNotFoundException($"File not found: {UssFilePath}"); + throw new FileNotFoundException($"File not found: {ussFilePath}"); } var root = new VisualElement();