Files
Gen_Hack-and-Slash-Roguelite/Client/Assets/Scripts/UI/ItemUI.cs

32 lines
701 B
C#

using System.Linq;
using Entity;
using Prefab;
using UnityEngine;
namespace UI
{
public class ItemUI : MonoBehaviour
{
public UIImageAnimator icon;
public InventorySlot inventorySlot;
private void Start()
{
icon.gameObject.SetActive(false);
}
public void SetDisplayItem(InventorySlot slot)
{
inventorySlot = slot;
if (inventorySlot == null)
{
icon.gameObject.SetActive(false);
}
else
{
icon.gameObject.SetActive(true);
icon.SetSprites(inventorySlot.Item.Icon.ToArray());
}
}
}
}