20 lines
444 B
C#
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;
|
|
}
|
|
}
|
|
}
|