22 lines
411 B
C#
22 lines
411 B
C#
using UnityEngine;
|
|
|
|
public class InteractableItem : MonoBehaviour, IInteractable
|
|
{
|
|
public ItemData itemData;
|
|
|
|
|
|
public void Interact()
|
|
{
|
|
bool added = InventorySystem.Instance.AddItem(itemData);
|
|
|
|
if (added)
|
|
{
|
|
Destroy(gameObject);
|
|
}
|
|
}
|
|
|
|
public string GetDescription()
|
|
{
|
|
return $"Подобрать {itemData.itemName}";
|
|
}
|
|
} |