28 lines
714 B
C#
28 lines
714 B
C#
using UnityEngine;
|
|
|
|
public class ShopingContainer : BaseInteractableObject
|
|
{
|
|
[SerializeField]
|
|
private ContainerSO _containerSO;
|
|
[SerializeField]
|
|
//private ItemActionsUI _actionsMenu;
|
|
|
|
public override void Interact(Player player)
|
|
{
|
|
base.Interact(player);
|
|
if (!player.IsHoldContainerItem())
|
|
{
|
|
var transform = Instantiate(_containerSO.prefab, _interactionPoint);
|
|
var containerItem = transform.GetComponent<ContainerItem>();
|
|
if (containerItem == null)
|
|
{
|
|
Debug.LogError("Container Item is null");
|
|
return;
|
|
}
|
|
player.SetContainerItem(containerItem);
|
|
}
|
|
}
|
|
|
|
|
|
}
|