28 lines
645 B
C#
28 lines
645 B
C#
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
|
||
|
namespace BeiBao.View
|
||
|
{
|
||
|
public class BeiBaoItem : MonoBehaviour
|
||
|
{
|
||
|
public Text NameText;
|
||
|
public Text CountText;
|
||
|
|
||
|
InventorySlot inventorySlot;
|
||
|
|
||
|
public void Refresh(InventorySlot slot)
|
||
|
{
|
||
|
inventorySlot = slot;
|
||
|
if (!inventorySlot.IsEmpty)
|
||
|
{
|
||
|
NameText.text = inventorySlot.Item.ItemName;
|
||
|
CountText.text = inventorySlot.Item.Quantity.ToString();
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
NameText.text = "";
|
||
|
CountText.text = "";
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|