Files
SimUL/Assets/Scripts/InteractableObjects/Items/ContainerItem.cs
T
2023-03-05 17:21:00 +02:00

40 lines
760 B
C#

using System.Collections.Generic;
using UnityEngine;
public class ContainerItem : MonoBehaviour
{
[SerializeField]
private ContainerSO _containerSO;
private List<SellableItemSO> _items;
private void Start()
{
_items = new List<SellableItemSO>();
}
public ContainerSO GetContainerObjectSO()
{
return _containerSO;
}
public void AddItem(SellableItemSO item)
{
if (_items.Count < _containerSO.MaxCapacity)
{
Debug.Log($"Player put to container a {item.ItemName}");
_items.Add(item);
}
else
{
Debug.Log("Container is full");
}
}
public List<SellableItemSO> GetItems()
{
return _items;
}
}