using UnityEditor; using UnityEngine; using UnityEngine.UIElements; namespace ProjectExporter { // This class provides static methods to create styled visual elements for the editor window. public static class ProjectExporterUI { // Creates a main container for a tab's content. public static VisualElement CreateMainContainer() { return new VisualElement { style = { paddingLeft = 10, paddingRight = 10, paddingTop = 10, paddingBottom = 10 } }; } // Creates a tab button. public static Button CreateTab(string label) { var button = new Button { text = label, style = { flexGrow = 1, borderBottomWidth = 1, borderBottomColor = Color.gray, marginLeft = 0, marginRight = 0 } }; return button; } // Creates a Foldout element for hierarchical display. public static Foldout CreateFoldout(string text) { var foldout = new Foldout { text = text, value = false, // Start collapsed style = { marginTop = 5 } }; return foldout; } // Creates a Toggle for selecting an asset. public static Toggle CreateToggle(string label) { var toggle = new Toggle { text = label, style = { marginTop = 2 } }; return toggle; } // Creates the "Generate" button. public static Button CreateGenerateButton() { var button = new Button { text = "Generate", style = { height = 30, marginTop = 20, backgroundColor = new StyleColor(new Color(0.2f, 0.6f, 0.2f)) } }; return button; } } }