void TryBuyLivesCallback (PurchaseItemResult result) { Debug.Log("Lives Purchased!"); GetInventory(); }
private void Callback_BuyItemSuccess(PlayFab.ClientModels.PurchaseItemResult result) { Database.Instance.DownloadAllInventoryCards(); inventoryCount++; transform.Find("Pf_StoreInventoryCount").Find("Panel").Find("txt_InventoryCount").GetComponent <UnityEngine.UI.Text>().text = inventoryCount.ToString(); }
/// <summary> /// Callback called when the user successfully buys something from the in-game store. /// </summary> /// <param name="result">Transaction result.</param> void OnPurchaseSuccess(PurchaseItemResult result) { GameplaySFXManager.instance.PlayItemUseSound(); for (int i = 0; i < result.Items.Count; i++) { this.ConsumeItem(result.Items[i].ItemInstanceId); this.actualCurrency -= (int)result.Items[i].UnitPrice; string[] itemInfo = result.Items[i].ItemId.Split('-'); PlayerStats statBought = (PlayerStats)System.Enum.Parse(typeof(PlayerStats), itemInfo[0]); float multiplier = float.Parse(itemInfo[1]); Debug.Log(statBought + " " + multiplier); GameplayUI.instance.UpdateCurrencyText(actualCurrency); OnStatsUpgradesCallback[statBought.GetHashCode()](multiplier); } }
void TryToSpinCallback (PurchaseItemResult result) { Debug.Log("Ticket Accepted! \nSPINNING..."); Debug.Log(string.Format("SPIN RESULT: {0}", result.Items[1].DisplayName)); GetInventory(); }
/// <summary> /// Purchase with virtual currency succeeded. /// </summary> /// <param name="result">Purchase info.</param> void OnPurchaseSuccess(PurchaseItemResult result) { this.OnBuySuccessCallback(result.Items); }