using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; public class ItemInfo : MonoBehaviour { public string status; public int accountName; public UnityEvent statusChanged; // 新增状态变化事件 // Start is called before the first frame update void Start() { } public void SetStatus(string newStatus) { status = newStatus; statusChanged.Invoke(); // 当状态改变时触发事件 } // Update is called once per frame void Update() { } }