using System.Collections.Generic; using AssetBank.DockableWindow.UIHelper; using AssetBank.Editor.DockableWindow; using UnityEditor; using UnityEngine; using UnityEngine.UIElements; namespace AssetBank.DockableWindow { public class ProjectExporterWindow : EditorWindow { private ProjectExporterController _controller; private VisualElement _rootElement; private VisualElement _contentContainer; private Dictionary _assetTrees; private string _currentTab = "General"; // Default to General tab // Checkbox states for the General tab private bool _exportScenes = true; private bool _exportPrefabs = true; private bool _exportScriptableObjects = true; private bool _exportMetaFiles = true; private bool _exportSettings = true; [MenuItem("Tools/GUI/Project Exporter")] public static void ShowWindow() { var wnd = GetWindow(); wnd.titleContent = new GUIContent("Project Exporter", EditorGUIUtility.IconContent("d_Profiler.GlobalIllumination").image); wnd.minSize = new Vector2(400, 300); } private void OnEnable() { _controller = new ProjectExporterController(); _assetTrees = new Dictionary(); _rootElement = rootVisualElement; BuildUI(); RefreshContent(_currentTab); } private void BuildUI() { _rootElement.Clear(); var tabContainer = new VisualElement { style = { flexDirection = FlexDirection.Row } }; tabContainer.Add(ProjectExporterUI.CreateTab("General")); // New General tab tabContainer.Add(ProjectExporterUI.CreateTab("Scenes")); tabContainer.Add(ProjectExporterUI.CreateTab("Prefabs")); tabContainer.Add(ProjectExporterUI.CreateTab("Scriptable Objects")); tabContainer.Add(ProjectExporterUI.CreateTab("Meta Files")); tabContainer.Add(ProjectExporterUI.CreateTab("Settings")); _rootElement.Add(tabContainer); var scrollView = new ScrollView(ScrollViewMode.Vertical); _rootElement.Add(scrollView); _contentContainer = ProjectExporterUI.CreateMainContainer(); scrollView.Add(_contentContainer); var generateButton = ProjectExporterUI.CreateGenerateButton(_currentTab == "General"); _rootElement.Add(generateButton); // The button's action will depend on the current tab generateButton.clicked += () => { if (_currentTab == "General") { PerformBulkExport(); } else if (_assetTrees.ContainsKey(_currentTab)) { _controller.ExportAssets(_assetTrees[_currentTab]); } }; var tabs = tabContainer.Query