using System; using System.Collections.Generic; using UnityEngine; // ReSharper disable once CheckNamespace namespace BlueWaterProject { [Serializable] public class PlayerInventory { [SerializeField] private List inventoryItemList = new(); public void AddItem(Item item, int count) { var existingItem = inventoryItemList.Find(i => i.Item.name == item.name); if (existingItem != null) { existingItem.Count += count; } else { inventoryItemList.Add(new InventoryItem(item, count)); } } } }