Ejemplo n.º 1
0
    public void SetData(FirstRechargeVO vO)
    {
        _icon.texture = ResourceManager.Load <Texture>(vO.RewardVo.IconPath, ModuleConfig.MODULE_ACTIVITY);
        _icon.GetComponent <RectTransform>().sizeDelta = new Vector2(200, 200);
        _num.text = vO.RewardVo.Num.ToString();


        if (vO.RewardVo.Resource != ResourcePB.Card)
        {
            PointerClickListener.Get(gameObject).onClick = go => { FlowText.ShowMessage(ClientData.GetItemDescById(vO.RewardVo.Id, vO.RewardVo.Resource).ItemDesc); };
        }
    }
    /// <summary>
    /// 发生领取首充奖励请求
    /// </summary>
    /// <param name="vO"></param>
    private void SendReceiveFirstPrizeReq(FirstRechargeVO vO)
    {
        Debug.Log("SendGroup===>" + vO.Group);
        ReceiveFirstPrizeReq req = new ReceiveFirstPrizeReq {
            Group = vO.Group
        };

        byte[] data = NetWorkManager.GetByteData(req);
        NetWorkManager.Instance.Send <ReceiveFirstPrizeRes>(CMD.ACTIVITY_RECEIVE_FIRSTPRIZE, data, res =>
        {
            GlobalData.PlayerModel.UpdataUserExtra(res.UserExtraInfo);
            //添加首冲回包奖励
            RewardUtil.AddReward(res.Awards);
            View.ShowGetCardAnimation(res.Awards.ToList());
        });
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 显示得到卡的动画
    /// </summary>
    public void ShowGetCardAnimation(List <AwardPB> list)
    {
        Action finish = () =>
        {
            //完成后首先隐藏
            gameObject.Hide();

            _temp = new List <FirstRechargeVO>();
            foreach (var item in list)
            {
                if (item.Resource == ResourcePB.Card)
                {
                    continue;
                }
                FirstRechargeVO vo = new FirstRechargeVO(item);
                _temp.Add(vo);
            }

            ModuleManager.Instance.GoBack();
            //打开奖励窗口
            if (_window == null)
            {
                _window = PopupManager.ShowWindow <FirstRechargeWindow>("ActivityFirstRecharge/Prefabs/FirstRechargeAwardShowWindow");
                _window.SetData(_temp);
            }
        };

        //从首充奖励回包中把卡的AwardPB拿出来
        List <AwardPB> temp = new List <AwardPB>();

        foreach (var item in list)
        {
            if (item.Resource == ResourcePB.Card)
            {
                temp.Add(item);
                break;
            }
        }


        SendMessage(new Message(MessageConst.CMD_FIRSTRECHARGE_HIDE_BACK_BTN));

        ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_DRAWCARD,
                                           false, false, "DrawCard_CardShow", temp, finish, false);
    }
Ejemplo n.º 4
0
    /// <summary>
    /// 初始化首充奖励
    /// </summary>
    private void InitFirstRechargeAwards()
    {
        var fixedAwardsRule    = _firstAwardRule.FixedAward;
        var optionalAwardsRule = _firstAwardRule.OptionalAward;

        if (_fixedAwards == null)
        {
            _fixedAwards = new List <FirstRechargeVO>();
        }

        if (_optionalAwards == null)
        {
            _optionalAwards = new List <FirstRechargeVO>();
        }

        foreach (var t in fixedAwardsRule)
        {
            var vo = new FirstRechargeVO(t);
            _fixedAwards.Add(vo);
        }

        for (int i = 0; i < optionalAwardsRule.Count; i++)
        {
            if (optionalAwardsRule[i].Resource != ResourcePB.Card)
            {
                continue;
            }
            var vo = new FirstRechargeVO(optionalAwardsRule[i])
            {
                Group = i + 1
            };
            _optionalAwards.Add(vo);
        }

        SetOptionalAwardsSort();
    }