Ejemplo n.º 1
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                switch (Network.ErrCode)
                {
                case Network.EErrCode.FirstChargeInvalid:
                    this.OnBack();
                    break;

                case Network.EErrCode.FirstChargeNoLog:
                    this.OnBack();
                    break;

                case Network.EErrCode.FirstChargeReceipt:
                    this.OnBack();
                    break;

                case Network.EErrCode.FirstChargePast:
                    this.OnBack();
                    break;

                default:
                    this.OnRetry();
                    break;
                }
            }
            else
            {
                WebAPI.JSON_BodyResponse <FlowNode_ReqFirstChargeBonus.Json> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqFirstChargeBonus.Json> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                Network.RemoveAPI();
                if (jsonObject.body == null)
                {
                    return;
                }
                ChargeInfoResultWindow component = (ChargeInfoResultWindow)((Component)this).get_gameObject().GetComponent <ChargeInfoResultWindow>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                {
                    List <FirstChargeReward> firstChargeRewardList = new List <FirstChargeReward>();
                    for (int index = 0; index < jsonObject.body.rewards.Length; ++index)
                    {
                        FirstChargeReward firstChargeReward = new FirstChargeReward(jsonObject.body.rewards[index]);
                        if (firstChargeReward != null)
                        {
                            firstChargeRewardList.Add(firstChargeReward);
                        }
                    }
                    if (firstChargeRewardList != null && firstChargeRewardList.Count > 0)
                    {
                        component.SetUp(firstChargeRewardList.ToArray());
                    }
                }
                this.Success();
            }
        }
Ejemplo n.º 2
0
 private void Refresh()
 {
     if (Object.op_Equality((Object)this.m_WindowAnim, (Object)null))
     {
         DebugUtility.LogError("Animator Not Found");
         this.m_IsRefresh = false;
     }
     else
     {
         if (!GameUtility.CompareAnimatorStateName((Component)this.m_WindowAnim, this.CheckAnimState))
         {
             return;
         }
         if (this.m_Rewards == null || this.m_Rewards.Count < 0)
         {
             DebugUtility.LogError("受け取り報酬が存在しません.");
         }
         else
         {
             for (int index = 0; index < this.m_Rewards.Count; ++index)
             {
                 FirstChargeReward reward     = this.m_Rewards[index];
                 GameObject        gameObject = (GameObject)null;
                 if (reward.CheckGiftTypes(GiftTypes.Item))
                 {
                     gameObject = this.SetItem(reward.iname, reward.num);
                     if (Object.op_Equality((Object)gameObject, (Object)null))
                     {
                         DebugUtility.LogError("[ChargeInfoResultWindow.cs]obj is null(Type:Item)!");
                         continue;
                     }
                 }
                 else if (reward.CheckGiftTypes(GiftTypes.Gold))
                 {
                     gameObject = this.SetGold(reward.num);
                     if (Object.op_Equality((Object)gameObject, (Object)null))
                     {
                         DebugUtility.LogError("[ChargeInfoResultWindow.cs]obj is null(Type:Gold)!");
                         continue;
                     }
                 }
                 else if (reward.CheckGiftTypes(GiftTypes.Coin))
                 {
                     gameObject = this.SetCoin(reward.num);
                     if (Object.op_Equality((Object)gameObject, (Object)null))
                     {
                         DebugUtility.LogError("[ChargeInfoResultWindow.cs]obj is null(Type:Coin)!");
                         continue;
                     }
                 }
                 else if (reward.CheckGiftTypes(GiftTypes.Unit))
                 {
                     gameObject = this.SetUnit(reward.iname);
                     if (Object.op_Equality((Object)gameObject, (Object)null))
                     {
                         DebugUtility.LogError("[ChargeInfoResultWindow.cs]obj is null(Type:Unit)!");
                         continue;
                     }
                 }
                 else if (reward.CheckGiftTypes(GiftTypes.Artifact))
                 {
                     gameObject = this.SetArtifact(reward.iname);
                     if (Object.op_Equality((Object)gameObject, (Object)null))
                     {
                         DebugUtility.LogError("[ChargeInfoResultWindow.cs]obj is null(Type:Artifact)!");
                         continue;
                     }
                 }
                 else if (reward.CheckGiftTypes(GiftTypes.ConceptCard))
                 {
                     gameObject = this.SetConceptCard(reward.iname);
                     if (Object.op_Equality((Object)gameObject, (Object)null))
                     {
                         DebugUtility.LogError("[ChargeInfoResultWindow.cs]obj is null(Type:ConceptCard)!");
                         continue;
                     }
                 }
                 if (Object.op_Inequality((Object)gameObject, (Object)null))
                 {
                     this.m_IconObj.Add(gameObject);
                 }
             }
             this.m_IsRefresh = false;
         }
     }
 }