using System; using UnityEditor; using UnityEngine; using UnityEngine.UIElements; namespace AlicizaX.UXTool { public class UXComponentCreateWindow : EditorWindow { public void SetCreateData(string path, System.Action callback) { uxCreateWindowVisualAsset.SetCallBack(path, callback); } private UXCreateWindowVisualAsset uxCreateWindowVisualAsset; private void CreateGUI() { uxCreateWindowVisualAsset = new UXCreateWindowVisualAsset(); rootVisualElement.Add(uxCreateWindowVisualAsset); } } public static class UXComponentCreateWindowHelper { public static void ShowWindow(string path, Action createCallBack) { UXComponentCreateWindow window = EditorWindow.GetWindow(true, "创建组件"); window.maxSize = new Vector2(400, 150); window.minSize = new Vector2(400, 150); window.Show(); window.SetCreateData(path, createCallBack); } } }