Files
SimUL/Assets/Scripts/InteractableObjects/ShopingBasket.cs
T
Vova 1774ab5b18 refactor interact system
interact only after PopupItemMenu button clicked
2023-11-16 16:11:39 +02:00

25 lines
679 B
C#

using UnityEngine;
public class ShopingContainer : BaseInteractableObject
{
[SerializeField]
private ContainerSO _containerSO;
[SerializeField]
//private ItemActionsUI _actionsMenu;
protected override void InteractAction()
{
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);
}
}
}