void OnPlayFabInventoryRetrieved(PlayFabPlayerInventoryCore inventory, PlayFabError error)
 {
     if (error == null)
     {
         Load(inventory);
     }
     else
     {
     }
 }
        void OnInventoryResponse(PlayFabPlayerInventoryCore inventory, PlayFab.PlayFabError error)
        {
            PlayFab.Player.Inventory.OnResponse -= OnInventoryResponse;

            if (error == null)
            {
                Popup.Hide();

                UpdateState();
            }
            else
            {
                Popup.Show(error.ErrorMessage, Popup.Hide, "Close");
            }
        }
Exemplo n.º 3
0
        void InventoryResponseCallback(PlayFabPlayerInventoryCore result, PlayFab.PlayFabError error)
        {
            PlayFab.Player.Inventory.OnResponse -= InventoryResponseCallback;

            if (error == null)
            {
                void Action()
                {
                    Popup.Hide();

                    Hide();
                }

                Popup.Show(Core.Localization.Phrases.Get("Purchase Successful"), Action, Core.Localization.Phrases.Get("Okay"));
            }
            else
            {
                RaiseError(error);
            }
        }
        void Load(PlayFabPlayerInventoryCore inventory)
        {
            funds.Load(inventory.VirtualCurrency);

            Items.Clear();

            for (int i = 0; i < inventory.Items.Count; i++)
            {
                var template = Core.Items.Find(inventory.Items[i].ItemId);

                if (template == null)
                {
                    Debug.LogWarning("No Item Template defined for Inventory Item with ID " + inventory.Items[i].ItemId + ", Skipping");
                    continue;
                }

                var data = new ItemData(template, inventory.Items[i]);

                Items.Add(data);
            }

            TriggerUpdate();
        }
        void InventoryResponseCallback(PlayFabPlayerInventoryCore result, PlayFabError error)
        {
            inventory.OnResponse -= InventoryResponseCallback;

            Respond(error);
        }