29 lines
580 B
C#
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()
|
|
{
|
|
|
|
}
|
|
}
|