Example #1
0
    protected void S2C_GetSevenDayRewardInfo(Pt _msg)
    {
        pt_ret_sevenDayRewardsInfo_f001 msg = _msg as pt_ret_sevenDayRewardsInfo_f001;

        if (msg != null)
        {
            day = msg.day;
            if (day > 7)
            {
                day = 7;
            }
            //Debug.Log("七天奖励数量   " + msg.rewards_info.Count);
            for (int i = 0; i < msg.rewards_info.Count; i++)
            {
                sevenDayReward data = msg.rewards_info[i];
                if (sevendDic.ContainsKey((int)data.type))
                {
                    SevendDayData info = sevendDic[(int)data.type];
                    if (info != null)
                    {
                        info.Update(data);
                    }
                }
                else
                {
                    SevendDayData info = new SevendDayData(data);
                    sevendDic[info.Type] = info;
                }
            }
            //if (isFirst && GameCenter.mainPlayerMng != null && GameCenter.mainPlayerMng.MainPlayerInfo != null)
            //{
            //    GameCenter.mainPlayerMng.MainPlayerInfo.OnBaseUpdate -= RefreshSevenOpen;
            //    GameCenter.mainPlayerMng.MainPlayerInfo.OnBaseUpdate += RefreshSevenOpen;
            //    isFirst = false;
            //}
            RefreshSevenOpen();
            //红点显示
            SetRedPoint();
        }
        if (OnRewardChange != null)
        {
            OnRewardChange();
        }
    }
Example #2
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="_data"></param>
 public void Update(sevenDayReward _data)
 {
     serverdata.type   = _data.type;
     serverdata.normal = _data.normal;
     serverdata.vip    = _data.vip;
 }
Example #3
0
 /// <summary>
 /// 通过服务端数据构造
 /// </summary>
 /// <param name="_data"></param>
 public SevendDayData(sevenDayReward _data)
 {
     serverdata = _data;
 }