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