Files
Survival/Assets/Scripts/Items/ItemObject.cs
2025-09-09 16:43:30 +01:00

29 lines
580 B
C#

using UnityEngine;
using static InteractionManager;
public class ItemObject : MonoBehaviour, IInteractable
{
public ItemData item;
public string GetInteractPrompt()
{
return string.Format("Pickup {0}", item.displayName);
}
public void OnInteract()
{
Inventory.instance.AddItem(item);
Destroy(gameObject);
}
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}