refactor interact system
interact only after PopupItemMenu button clicked
This commit is contained in:
@@ -11,16 +11,15 @@ public class CashierDesk : BaseInteractableObject
|
||||
private List<JobInfoSO> _jobsInfoList;
|
||||
private JobInfoSO _playerJob;
|
||||
|
||||
public override void Interact(Player player)
|
||||
protected override void InteractAction()
|
||||
{
|
||||
base.Interact(player);
|
||||
if (player.IsHoldContainerItem())
|
||||
if (_player.IsHoldContainerItem())
|
||||
{
|
||||
BuyItems();
|
||||
}
|
||||
else
|
||||
{
|
||||
_playerJob = _jobsInfoList.Where(x => x.JobPosition == player.JobPosition).FirstOrDefault();
|
||||
_playerJob = _jobsInfoList.Where(x => x.JobPosition == _player.JobPosition).FirstOrDefault();
|
||||
print($"playerJob is {_playerJob}");
|
||||
if (_playerJob != null)
|
||||
{
|
||||
@@ -31,7 +30,7 @@ public class CashierDesk : BaseInteractableObject
|
||||
{
|
||||
print("You don't work here");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void BuyItems()
|
||||
|
||||
Reference in New Issue
Block a user