using UnityEngine;
public class StorageInteractable : InteractableObject
{
public Transform storageHolder;
private void Awake()
{
item = GetComponent<Item>();
if (item == null)
{
Debug.LogError("StorageInteractable requires an Item component on the same GameObject.");
enabled = false;
}
}
private void Start()
{
if (item != null && storageHolder != null)
{
StorageSystem.Instance.InitializeStorage(item);
StorageSystem.Instance.RegisterStorage(item, storageHolder);
}
}
public override void Interact(PlayerMovement playerMovement, bool isRightClick)
{
if (isRightClick)
{
UIManager.Instance.ShowInventoryPrompt(item);
}
else
{
base.Interact(playerMovement, isRightClick);
}
}
}