using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class ItemObj : MonoBehaviour { [SerializeField] private Image icon; [SerializeField] private GameObject back; [SerializeField] private Text name; [SerializeField] private Text num; [SerializeField] public int itemId; public void SetData(int id,int n=0) { itemId = id; var data = JsonTab.Instance.tables.Item.Get(id); icon.sprite = AssetBundleManager.ins.Sprite(data.Icon, AtlasType.ItemIcon); name.text = data.Propname; num.text = n.ToString(); if (back != null) { back.gameObject.SetActive(!DataManager.GetItemUnLock(id)); } } }