From 96480dd48818c886798016b1ae587e1b6bbddc80 Mon Sep 17 00:00:00 2001 From: cneicy Date: Wed, 26 Aug 2026 12:48:35 +0800 Subject: [PATCH] feat(installer): rebuild package manager with ui toolkit --- Development~/UnityProject/Assets/Editor.meta | 8 + .../ShrinkInstallerDevelopmentValidation.cs | 74 +++ ...rinkInstallerDevelopmentValidation.cs.meta | 11 + Editor/ShrinkSdkInstallerWindow.cs | 494 +++++++++++++++--- Editor/ShrinkSdkManifestStore.cs | 25 +- Editor/ShrinkSdkPackageCatalog.cs | 201 ++++++- README.md | 18 +- package.json | 6 +- 8 files changed, 702 insertions(+), 135 deletions(-) create mode 100644 Development~/UnityProject/Assets/Editor.meta create mode 100644 Development~/UnityProject/Assets/Editor/ShrinkInstallerDevelopmentValidation.cs create mode 100644 Development~/UnityProject/Assets/Editor/ShrinkInstallerDevelopmentValidation.cs.meta diff --git a/Development~/UnityProject/Assets/Editor.meta b/Development~/UnityProject/Assets/Editor.meta new file mode 100644 index 0000000..27f6b95 --- /dev/null +++ b/Development~/UnityProject/Assets/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7a6ed64b6b38b5e4eae9b86516add8b7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Development~/UnityProject/Assets/Editor/ShrinkInstallerDevelopmentValidation.cs b/Development~/UnityProject/Assets/Editor/ShrinkInstallerDevelopmentValidation.cs new file mode 100644 index 0000000..eb33aea --- /dev/null +++ b/Development~/UnityProject/Assets/Editor/ShrinkInstallerDevelopmentValidation.cs @@ -0,0 +1,74 @@ +#if UNITY_EDITOR +using System; +using System.Collections; +using System.Linq; +using System.Reflection; +using UnityEditor; +using UnityEngine; +using UnityEngine.UIElements; + +public static class ShrinkInstallerDevelopmentValidation +{ + public static void Run() + { + try + { + var windowType = FindType("ShrinkSDK.Installer.ShrinkSdkInstallerWindow"); + var window = ScriptableObject.CreateInstance(windowType) as EditorWindow + ?? throw new InvalidOperationException("无法创建包管理窗口。"); + try + { + windowType.GetMethod("CreateGUI", BindingFlags.Public | BindingFlags.Instance)?.Invoke(window, null); + var texts = window.rootVisualElement.Query