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

20 lines
413 B
C#

using UnityEngine;
public class StoreContainer : BaseInteractableObject
{
[SerializeField]
private SellableItemSO _sellableItemSO;
protected override void InteractAction()
{
if (_player.IsHoldContainerItem())
{
var clone = Instantiate(_sellableItemSO);
var container = _player.GetContainerItem();
container.AddItem(clone);
}
}
}