using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using Unity.VisualScripting; using UnityEditor.UIElements; using UnityEngine; using UnityEngine.UIElements; // 这个controller 是用于控制 Shopping UI菜单的 public class ShoppingController : MonoBehaviour { // Start is called before the first frame update // 主页面元素 private Button foodButton, toyButton, otherButton, backButton; private Label coinQty; private List shoppingItems = new(); private VisualElement itemListView; //弹窗元素 private Button yesButton, noButton; private Label msgBody; private VisualElement msgRoot, msgField; // 选中的产品 private string selectedItemId; void Start() { // 基层元素获取 var root = GetComponent().rootVisualElement; var mainManu = root.Q("mainManu"); itemListView = root.Q("itemListView"); foodButton = mainManu.Q