Ejemplo n.º 1
0
    private void CallbackSuccess()
    {
        AddCoinPopup popup = PopupSystem.GetPopup <AddCoinPopup>(Define.PopupType.AddCoin);

        popup.SetData(DataManager.GetDesignValue(Define.GameDesign.FreeCoin), () =>
        {
            DataManager.GetInstance().AfterShowFreeCoinVideo();
        });
        PopupSystem.OpenPopup(Define.PopupType.AddCoin, OnCloseButton);
    }
Ejemplo n.º 2
0
 public void GetReward(Define.RewardType rewardType)
 {
     if (rewardDic.ContainsKey(rewardType))
     {
         int rewardCoin = 0;
         if (rewardDic[rewardType].TryGetReward(ref rewardCoin))
         {
             AddCoinPopup popup = PopupSystem.GetPopup <AddCoinPopup>(Define.PopupType.AddCoin);
             popup.SetData(rewardCoin);
             PopupSystem.OpenPopup(Define.PopupType.AddCoin);
         }
     }
 }
Ejemplo n.º 3
0
    private void OnClickBuyButton(int idx)
    {
        string productKey = "";

        if (DataManager.GetInstance().TryGetProductKey(idx, ref productKey))
        {
            InAppPurchaser.BuyProduct(productKey, (string key) =>
            {
                int value = 0;
                if (DataManager.GetInstance().TryGetProductValue(key, ref value))
                {
                    UISystem.UpdateNews();

                    AddCoinPopup popup = PopupSystem.GetPopup <AddCoinPopup>(Define.PopupType.AddCoin);
                    popup.SetData(value);
                    PopupSystem.OpenPopup(Define.PopupType.AddCoin, OnCloseButton);

                    UnityEngine.Analytics.Analytics.CustomEvent("buy product", new Dictionary <string, object>
                    {
                        { productKey, key }
                    });
                }
                else
                {
                    BasicPopup popup = PopupSystem.GetPopup <BasicPopup>(Define.PopupType.Basic);
                    popup.SetData(DataManager.GetText(TextTable.errorBuyProductKey));
                    PopupSystem.OpenPopup(Define.PopupType.Basic);

                    UnityEngine.Analytics.Analytics.CustomEvent("product error", new Dictionary <string, object>
                    {
                        { productKey, key }
                    });
                }
            });
        }
    }