using System; using System.Collections.Generic; using System.Linq; using MCPForUnity.Editor.Constants; using MCPForUnity.Editor.Helpers; using MCPForUnity.Editor.Services; using UnityEditor; using UnityEngine.UIElements; namespace MCPForUnity.Editor.Windows.Components.Resources { /// /// Controller for the Resources section inside the MCP For Unity editor window. /// Provides discovery, filtering, and per-resource enablement toggles. /// public class McpResourcesSection { private readonly Dictionary resourceToggleMap = new(); private Label summaryLabel; private Label noteLabel; private Button enableAllButton; private Button disableAllButton; private Button rescanButton; private VisualElement categoryContainer; private List allResources = new(); public VisualElement Root { get; } public McpResourcesSection(VisualElement root) { Root = root; CacheUIElements(); RegisterCallbacks(); } private void CacheUIElements() { summaryLabel = Root.Q