public void UnlockContainer()
 {
     DialogCanvasController.RequestItemViewer(new List <string>()
     {
         selectedItem.itemData.category.catalogRef.ItemId
     }, true);
     HideSelectedItem();
 }
Пример #2
0
 public void UnlockContainer()
 {
     if (this.activeMode == InventoryMode.Character)
     {
         DialogCanvasController.RequestItemViewer(new List <string>()
         {
             selectedItem.itemData.category.catalogRef.ItemId
         });
     }
     else
     {
         DialogCanvasController.RequestItemViewer(new List <string>()
         {
             selectedItem.itemData.category.catalogRef.ItemId
         }, true);
     }
 }
Пример #3
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="wasAlreadyRedemed">If set to <c>true</c>  if the player has already redeemed this offer.</param>
    public void ContinueClicked(bool wasAlreadyRedemed = false)
    {
        UnityAction <string> afterRedeem = (string result) =>
        {
            if (!string.IsNullOrEmpty(result))
            {
                DialogCanvasController.RequestItemViewer(new List <string>()
                {
                    result
                }, true);
            }

            PF_PlayerData.OfferContainers.RemoveAt(0);
            this.Init();
        };

        PF_PlayerData.RedeemItemOffer(this.activeItem, this.activeInstance.ItemInstanceId, afterRedeem, wasAlreadyRedemed);
    }
Пример #4
0
 public void ShowItemsFound()
 {
     DialogCanvasController.RequestItemViewer(PF_GamePlay.QuestProgress.ItemsFound);
 }
Пример #5
0
    public static void OnReportAdActivitySuccess(RewardAdActivityResponse result)
    {
        Debug.Log("OnReportAdActivitySuccess!");
        Debug.Log(string.Format("Retrieved {0} items and {1} VCs.", result.RewardResults.GrantedItems.Count, result.RewardResults.GrantedVirtualCurrencies.Count));

        var gotItems = false;
        var gotVc    = false;

        var           output    = "Congratulations! ";
        List <string> itemGifts = new List <string>();

        if (result.RewardResults.GrantedItems != null && result.RewardResults.GrantedItems.Count > 0)
        {
            gotItems = true;
            output  += "You received: " + result.RewardResults.GrantedItems.Count + " new items";

            foreach (var item in result.RewardResults.GrantedItems)
            {
                itemGifts.Add(item.ItemId);
            }
        }

        if (result.RewardResults.GrantedVirtualCurrencies != null && result.RewardResults.GrantedVirtualCurrencies.Count > 0)
        {
            gotVc = true;

            var count = 0;
            foreach (var grant in result.RewardResults.GrantedVirtualCurrencies)
            {
                if (gotItems || count > 0)
                {
                    output += "; ";
                }
                else
                {
                    output += "You received: ";
                }

                output += string.Format("{1}({0})", grant.Key, grant.Value);

                count++;
            }

            output += " in Virtual Currencies";
        }

        if (result.RewardResults.IncrementedStatistics != null && result.RewardResults.IncrementedStatistics.Count > 0)
        {
            var count = 0;
            foreach (var stat in result.RewardResults.IncrementedStatistics)
            {
                if (gotItems || gotVc || count > 0)
                {
                    output += "; ";
                }

                output += string.Format(" Your \"{0}\" increased by {1}", stat.Key, stat.Value);

                count++;
            }
        }

        if (gotItems)
        {
            output += ".\n Click the check mark to view your new items.";
        }

        if (OnAdRewarded != null)
        {
            OnAdRewarded(result);
        }

        DialogCanvasController.RequestConfirmationPrompt("You were granted a gift!", output, response =>
        {
            if (response && gotItems)
            {
                DialogCanvasController.RequestItemViewer(itemGifts);
            }
        });
    }