refactor interact system

interact only after PopupItemMenu button clicked
This commit is contained in:
Vova
2023-11-16 16:11:39 +02:00
parent c2bb35a46d
commit 1774ab5b18
12 changed files with 100 additions and 61 deletions
@@ -7,10 +7,9 @@ public class ShopingContainer : BaseInteractableObject
[SerializeField]
//private ItemActionsUI _actionsMenu;
public override void Interact(Player player)
protected override void InteractAction()
{
base.Interact(player);
if (!player.IsHoldContainerItem())
if (!_player.IsHoldContainerItem())
{
var transform = Instantiate(_containerSO.prefab, _interactionPoint);
var containerItem = transform.GetComponent<ContainerItem>();
@@ -19,9 +18,7 @@ public class ShopingContainer : BaseInteractableObject
Debug.LogError("Container Item is null");
return;
}
player.SetContainerItem(containerItem);
_player.SetContainerItem(containerItem);
}
}
}