using System.Collections.Generic; using System.Linq; using UnityEngine; using UnityEngine.UIElements; public class ShopUI : MonoBehaviour { [Header("Shop Settings")] public Shop currentShop; private UIDocument uiDocument; private Character currentCharacter; private Bank currentBank; private Inventory currentInventory; // UI Elements private VisualElement shopContainer; private TextField searchField; private DropdownField categoryFilter; private ScrollView itemList; private Label shopTitle; private Label playerMoney; private Button closeButton; // Current filter state private ItemType? currentFilter = null; private string currentSearchTerm = ""; void Awake() { uiDocument = GetComponent(); if (uiDocument == null) { Debug.LogError("ShopUI requires a UIDocument component"); return; } InitializeUI(); } void InitializeUI() { var root = uiDocument.rootVisualElement; shopContainer = root.Q("ShopContainer"); searchField = root.Q("SearchField"); categoryFilter = root.Q("CategoryFilter"); itemList = root.Q("ItemList"); shopTitle = root.Q