ItemSlotUI

 avatar
user_3183455
csharp
11 days ago
723 B
1
Indexable
Never
 
using TMPro;
using UnityEngine;
using UnityEngine.UI;
 
namespace CuongMono.Item
{
    public abstract class ItemSlotUI : MonoBehaviour
    {
        [Header("Item Slot UI")]
        [SerializeField] protected Image iconImage;
        [SerializeField] protected TextMeshProUGUI quanityText;
 
        protected CanvasGroup canvasGroup;
        public int SlotIndex { get; private set; }
 
        public abstract Item Item { get; set; }
        private void Start()
        {
            this.canvasGroup = this.iconImage.GetComponent<CanvasGroup>();
            this.SlotIndex = transform.GetSiblingIndex();
            this.UpdateUI();
        }
        public abstract void UpdateUI();
    }
}
Leave a Comment