Buyable Item - a simple component allowing you to organize the purchase of something.
Button Buy - button with Button Buy component that has resource icon and text with price.
Price - item price.
Payment Resource - resource to which the purchase will be paid.
On Bought() - an event that is called if the purchase is successful.
QUESTIONS:
How to subscribe OnBought() event?
[SerializeField] private BuyableItem _buyableItem;
private void Start()
{
_buyableItem.OnBought.AddListener(OnBought);
}
private void OnBought()
{
Debug.Log("Bought");
}