public void ChangeSelected(BuyableColor _color) { if (_currentSelectedColor != null) { _currentSelectedColor.SetSelected(false); } _color.SetSelected(true); _currentSelectedColor = _color; text.text = "Price: " + _color.itemData.sbPrice + " SB"; }
public void PurchaseSelectedColor() { if (_currentSelectedColor == null) { return; } var request = new PurchaseItemRequest { ItemId = _currentSelectedColor.itemData.itemId, Price = (int)_currentSelectedColor.itemData.sbPrice, VirtualCurrency = "SB" }; _currentSelectedColor.gameObject.SetActive(false); _currentSelectedColor = null; PlayFabClientAPI.PurchaseItem(request, PurchaseSuccessCallback, PurchaseErrorCallback); }