Example #1
0
    private void RGetWeeklyLogin(ApiBridge.ResponseParam response)
    {
        Logger.E("Return GetWeeklyLogin: " + response.post_data);
        JGetWeeklyLogin json = JsonUtility.FromJson <JGetWeeklyLogin> (response.post_data);

        if (json.reward.item_amount == null)
        {
            WeeklyRewardsManager.instance.SetJson(json);
        }
        else
        {
            int             itemValue = int.Parse(json.reward.item_amount);
            ItemReceiveData data      = new ItemReceiveData(json.reward.item_type, json.reward.item_id, itemValue);
            ReceiveItemManager.instance.itemsData.Add(data);
            if (json.bonus_reward.item_amount != null)
            {
                int             bonusItemValue = int.Parse(json.bonus_reward.item_amount);
                ItemReceiveData bonusData      = new ItemReceiveData(json.bonus_reward.item_type, json.bonus_reward.item_id, bonusItemValue);
                ReceiveItemManager.instance.itemsData.Add(bonusData);
            }
            ReceiveItemManager.instance.ShowCombined();
            PlayerData.jHome.can_claim_weekly = false;
            PlayerData.owned_coin             = Convert.ToInt64(json.player.coin);
            PlayerData.owned_coupon           = Convert.ToInt64(json.player.coupon);
            _SceneManager.instance.UpdateAllCoinAndCoupon();
            WeeklyRewardsManager.instance.SetWeeklyDaysStatus(json);
            WeeklyRewardsManager.instance.IncrementProgressBar();
            WeeklyRewardsManager.instance.json.login_count++;
        }
    }
Example #2
0
 public void SetWeeklyDaysStatus(JGetWeeklyLogin json)
 {
     for (int a = 0; a < itemWeeklyDays.Length; a++)
     {
         if (json.today - 1 == a)
         {
             itemWeeklyDays[a].objDimmer.SetActive(false);
             if (PlayerData.jHome.can_claim_weekly)
             {
                 //itemWeeklyDays[a].objDimmer.SetActive (false);
                 itemWeeklyDays[a].objClaimed.SetActive(false);
             }
             else
             {
                 //itemWeeklyDays[a].objDimmer.SetActive (true);
                 itemWeeklyDays[a].objClaimed.SetActive(true);
             }
         }
         else
         {
             itemWeeklyDays[a].objDimmer.SetActive(true);
             itemWeeklyDays[a].objClaimed.SetActive(false);
         }
     }
 }
Example #3
0
 public void SetJson(JGetWeeklyLogin _json)
 {
     json          = _json;
     isSettingJson = false;
 }