25 lines
597 B
C#
Raw Normal View History

2024-12-16 17:25:10 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ItemObj : MonoBehaviour
{
[SerializeField] private Image icon;
[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();
}
}