public void HandleCallbackSuccess(string details, PlayFabAPIMethods method, MessageDisplayStyle style)
    {
        switch (method)
        {
        case PlayFabAPIMethods.MakePurchase:
            // refresh after purchase.
            if (PF_PlayerData.activeCharacter == null)
            {
                PF_PlayerData.GetUserAccountInfo();
            }
            else
            {
                PF_PlayerData.GetCharacterInventory(PF_PlayerData.activeCharacter.characterDetails.CharacterId);
            }
            break;

        case PlayFabAPIMethods.GetCharacterInventory:
            DialogCanvasController.RequestStore(this.StoreName.text);
            break;

        case PlayFabAPIMethods.GetAccountInfo:
            DialogCanvasController.RequestStore(this.StoreName.text);
            break;
        }
    }
Exemple #2
0
    private static void OnGetCatalogSuccess(GetCatalogItemsResult result)
    {
        catalogItems.Clear();
        foreach (var eachItem in result.Catalog)
        {
            catalogItems[eachItem.ItemId] = eachItem;
        }

        PF_PlayerData.GetUserAccountInfo();
    }
 private void HandlePlayfabCallbackSuccess(string details, PlayFabAPIMethods method, MessageDisplayStyle displayStyle)
 {
     if (method == PlayFabAPIMethods.DrawCharacterToUser)
     {
         ShowGrantedCharacterImage(details);
         debugText.text = details;
         PF_PlayerData.GetUserAccountInfo();
     }
     if (method == PlayFabAPIMethods.GetAccountInfo)
     {
         vcText.text = PF_PlayerData.virtualCurrency["NT"].ToString();
         CanPlayerDraw();
     }
 }
Exemple #4
0
    public static void CharacterSelectDataRefresh()
    {
        //Debug.Log("Ran CharacterSelectDataRefresh");
        PF_PlayerData.GetUserAccountInfo();
        PF_GameData.GetTitleData();
        //PF_GameData.GetTitleNews();
        PF_GameData.GetCatalogInfo();
        //PF_GameData.GetOffersCatalog();

        System.Action action = () =>
        {
            PF_PlayerData.GetCharacterData();
        };

        PF_PlayerData.GetPlayerCharacters(action);
        //PF_PlayerData.GetCharacterData();
        //PF_PlayerData.GetUserStatistics();
    }
Exemple #5
0
    private static void OnGetCatalogSuccess(GetCatalogItemsResult result)
    {
        catalogItems = result.Catalog;

        PF_PlayerData.GetUserAccountInfo();
    }
    public void AfterUnlock(UnlockContainerItemResult result)
    {
        // build our list for displaying the container results
        List <ContainerResultItem> items = new List <ContainerResultItem>();
        int counts = 0;

        foreach (var award in result.GrantedItems)
        {
            string      awardIcon            = "Default";
            CatalogItem catItem              = PF_GameData.catalogItems.Find((i) => { return(i.ItemId == award.ItemId); });
            Dictionary <string, string> kvps = PlayFabSimpleJson.DeserializeObject <Dictionary <string, string> >(catItem.CustomData);
            //kvps.TryGetValue("icon", out awardIcon);

            items.Add(new ContainerResultItem()
            {
                displayIcon = new Sprite(),//GameController.Instance.iconManager.GetIconById(awardIcon),
                displayName = award.DisplayName
            });

            if (counts < 5)
            {
                UnpackedItemPrefab[counts].gameObject.SetActive(true);
                UnpackedItemPrefab[counts].BtnInitialize(new Sprite(), award.DisplayName, (int)award.UsesIncrementedBy);
            }
            else
            {
                return;
            }

            counts++;
        }

        if (result.VirtualCurrency != null)
        {
            foreach (var award in result.VirtualCurrency)
            {
                items.Add(new ContainerResultItem()
                {
                    displayIcon = new Sprite(),//GameController.Instance.iconManager.GetIconById(award.Key),
                    displayName = string.Format("{1} Award: {0}", award.Value, award.Key)
                });

                if (counts < 5)
                {
                    UnpackedItemPrefab[counts].gameObject.SetActive(true);
                    UnpackedItemPrefab[counts].BtnInitialize(new Sprite(), award.Key, (int)award.Value);
                }
                else
                {
                    return;
                }

                counts++;
            }
            PF_PlayerData.GetUserAccountInfo();
        }
        else
        {
            Debug.LogError("check plz");
            //CatalogItem catRef = PF_GameData.catalogItems.Find((i) => { return i.ItemId == this.selectedItem.ItemId; });
            //if (catRef.Container.VirtualCurrencyContents.Count > 0)
            //{
            //    foreach (var vc in catRef.Container.VirtualCurrencyContents)
            //    {
            //        items.Add(new ContainerResultItem()
            //        {
            //            displayIcon = GameController.Instance.iconManager.GetIconById(vc.Key),
            //            displayName = string.Format("{1} Award: {0}", vc.Value, vc.Key)
            //        });
            //    }
            //}
        }

        gameObject.SetActive(true);

        DialogCanvasController.RequestInventoryPrompt();
    }