sasalka/Code/Inventory/InventoryItem.cs
2025-06-26 01:56:08 +03:00

20 lines
444 B
C#

using Sandbox;
using Sandbox.UI;
namespace Sasalka;
public class InventoryItem : Component
{
[Property] public BaseItemDefinition Definition { get; set; }
[Property] public int Count { get; set; } = 1;
[Property] public bool Equipped { get; set; } = false;
protected override void OnStart()
{
if ( GameObject.Components.TryGet<PickupItem>( out var item ) ) //FindMode.EverythingInSelf
{
item.Label = Definition.Name;
}
}
}