public void RecruitWaiter() { PurchaseItemRequest request = new PurchaseItemRequest(); request.ItemId = "waiter_cat"; request.CatalogVersion = "Items"; request.VirtualCurrency = "NM"; request.Price = 0; PlayFabClientAPI.PurchaseItem(request, result => { PlayFabLogin.GetMoney(); //gameObject.SetActive(false); //result is a List<ItemInstance> object Debug.Log("got a cat!"); PlayFabLogin.SetItemCutsomData(data.GetCustomDataFromWaiterData(), result.Items[0].ItemInstanceId, PlayFabLogin.playerId); }, error => { Debug.LogError(error.ErrorMessage); }); }
public void CompletePurchase() { PurchaseItemRequest request = new PurchaseItemRequest(); request.ItemId = "" + data.id; request.CatalogVersion = "Items"; request.VirtualCurrency = "NM"; request.Price = data.cost; DecorationData d = data; PlayFabClientAPI.PurchaseItem(request, result => { Debug.Log("Purchased!"); PlayFabLogin.GetMoney(); CatInventory.catInv.SortChoice(); gameObject.SetActive(false); //result is a List<ItemInstance> object CatInventory.catInv.AddOwnedDecoration(d, result.Items[0]); }, error => { Debug.LogError(error.ErrorMessage); }); data = null; }