25 lines
597 B
C#
25 lines
597 B
C#
|
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();
|
||
|
|
||
|
}
|
||
|
}
|