using System.Collections; using System.Collections.Generic; using System.IO; using DG.Tweening; using UnityEditor; using UnityEditor.SceneManagement; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UIElements; using System.Reflection; using System; using System.Linq; public class AutoGenerate : EditorWindow { private VisualElement rootElement; private Button generateBtn; private Label hintText; private TextField nameInput; private string scenePath; private string scriptPath; private string prefabPath; private string uiSpritePath; [MenuItem("Window/Generate Editor Window")] public static void ShowExample() { AutoGenerate wnd = GetWindow(); wnd.titleContent = new GUIContent("Auto Generate UI Window"); } public void CreateGUI() { scenePath = "Assets/SandBox/TestUIPanelScenes"; scriptPath = "Assets/Project/UI/UI_Panel"; prefabPath = "Assets/Resources/UI/UI_Panel"; uiSpritePath="Assets/ArtRes/Sprite/UI_Panel"; // scenePath = "Assets/Test1"; // scriptPath = "Assets/Test2"; // prefabPath = "Assets/Test3"; var visualTree = AssetDatabase.LoadAssetAtPath( "Assets/ThirdPart/UIToolKitFile/UDoc/UXml/AutoGenerateUI.uxml"); rootElement = visualTree.CloneTree(); rootVisualElement.Add(rootElement); generateBtn = rootElement.Q