display player money, dialog when player have not enough money

This commit is contained in:
2022-08-19 00:21:47 +03:00
parent 32cdf47d4a
commit 58875abc52
7 changed files with 70 additions and 13 deletions
@@ -42,7 +42,20 @@ public class ChoiceController : MonoBehaviour
public void MakeChoice()
{
playerController.TryBuyAction(_option.Value);
conversationChangeEvent.Invoke(_option.Value);
if (playerController.TryBuyAction(_option.Value))
{
conversationChangeEvent.Invoke(_option.Value);
}
else
{
YesNoDialogUI.Instance.ShowQuestion("not enouth money",
() =>
{
},
() =>
{
//do nothing
});
}
}
}