ProjectDDD/Assets/_DDD/_Scripts/GameState/InventoryItemData.cs

23 lines
508 B
C#

using System;
using UnityEngine;
namespace DDD
{
[Serializable]
public class InventoryItemData : IId
{
[field: SerializeField]
public string Id { get; set; }
[field: SerializeField]
public int Quantity { get; set; }
public InventoryItemData(string id, int quantity)
{
Id = id;
Quantity = quantity;
}
public ItemData ItemData => InventoryManager.Instance.GetItemDataByIdOrNull(Id);
}
}