From 0e8b80085d8f8d91584986c24a9d87aa70081218 Mon Sep 17 00:00:00 2001 From: Dero Date: Wed, 25 Feb 2026 10:50:03 +0100 Subject: [PATCH] Loading assets via guid instead of absolute paths Fixes ayellowpaper/SerializedDictionary#7 --- .../KeyListGenerators/KeyListGeneratorSelectorWindow.cs | 6 ++++-- Editor/Scripts/SerializedDictionaryDrawer.cs | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Editor/Scripts/KeyListGenerators/KeyListGeneratorSelectorWindow.cs b/Editor/Scripts/KeyListGenerators/KeyListGeneratorSelectorWindow.cs index 2ad0e77..66327b5 100644 --- a/Editor/Scripts/KeyListGenerators/KeyListGeneratorSelectorWindow.cs +++ b/Editor/Scripts/KeyListGenerators/KeyListGeneratorSelectorWindow.cs @@ -25,7 +25,9 @@ public class KeyListGeneratorSelectorWindow : EditorWindow private void OnEnable() { - VisualTreeAsset document = AssetDatabase.LoadAssetAtPath("Assets/Plugins/SerializedCollections/Editor/Assets/KeysGeneratorSelectorWindow.uxml"); + //Editor/Assets/KeysGeneratorSelectorWindow.uxml + var assetPath = AssetDatabase.GUIDToAssetPath("681c8a924c8b1e14b9fe53bb7397ec3d"); + VisualTreeAsset document = AssetDatabase.LoadAssetAtPath(assetPath); var element = document.CloneTree(); element.style.height = new StyleLength(new Length(100, LengthUnit.Percent)); rootVisualElement.Add(element); @@ -179,4 +181,4 @@ private KeyListGenerator GetOrCreateKeysGenerator(Type type) return _keysGenerators[type]; } } -} \ No newline at end of file +} diff --git a/Editor/Scripts/SerializedDictionaryDrawer.cs b/Editor/Scripts/SerializedDictionaryDrawer.cs index afc3980..e8050e5 100644 --- a/Editor/Scripts/SerializedDictionaryDrawer.cs +++ b/Editor/Scripts/SerializedDictionaryDrawer.cs @@ -35,7 +35,9 @@ internal static GUIContent DisplayTypeToggleContent { if (_displayTypeToggleContent == null) { - var texture = AssetDatabase.LoadAssetAtPath("Assets/Plugins/SerializedCollections/Editor/Assets/BurgerMenu@2x.png"); + //Editor/Assets/BurgerMenu@2x.png + var assetPath = AssetDatabase.GUIDToAssetPath("8deddfed9f39d7740879d2cb0fcf7ce0"); + var texture = AssetDatabase.LoadAssetAtPath(assetPath); _displayTypeToggleContent = new GUIContent(texture, "Toggle to either draw existing editor or draw properties manually."); } return _displayTypeToggleContent; @@ -59,4 +61,4 @@ public override float GetPropertyHeight(SerializedProperty property, GUIContent return _arrayData[property.propertyPath].GetPropertyHeight(label); } } -} \ No newline at end of file +}