using System.Collections.Generic; using Assets.HeroEditor4D.InventorySystem.Scripts.Data; using UnityEngine; namespace Assets.HeroEditor4D.InventorySystem.Scripts.Elements { /// /// Abstract item container. It can be inventory bag, player equipment or trader goods. /// public abstract class ItemContainer : MonoBehaviour { /// /// List of items. /// public List Items { get; protected set; } = new List(); [Header("Settings")] [Tooltip("Stack identical inventory items to a single UI element.")] public bool Stacked = true; public bool AutoSelect = true; public abstract void Refresh(Item selected); public void Initialize(ref List items, Item selected = null) { Items = items; Refresh(selected); } } }