Example #1
0
    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); });
    }
Example #2
0
    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;
    }