2025-12-01 16:46:28 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using UnityEditor;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
using UnityEngine.UIElements;
|
|
|
|
|
|
|
2025-12-09 20:31:44 +08:00
|
|
|
|
namespace AlicizaX.UXTool
|
2025-12-01 16:46:28 +08:00
|
|
|
|
{
|
|
|
|
|
|
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<UXComponentCreateWindow>(true, "创建组件");
|
|
|
|
|
|
window.maxSize = new Vector2(400, 150);
|
|
|
|
|
|
window.minSize = new Vector2(400, 150);
|
|
|
|
|
|
window.Show();
|
|
|
|
|
|
window.SetCreateData(path, createCallBack);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|