Beispiel #1
0
    void OnClickRewardBox(GameObject caster)
    {
        uint state = 0;

        if (hasGot)
        {
            state = 2;
        }
        else
        {
            if (canGet)
            {
                state = 1;
            }
            else
            {
                state = 0;
            }
        }
        ActiveTakeParam par = new ActiveTakeParam();

        par.type        = ActiveTakeType.Daily;
        par.boxID       = id;
        par.canGetState = state;
        par.ids         = DataManager.Manager <DailyManager>().RewardBoxList;
        DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.ActiveTakePanel, data: par);
    }
Beispiel #2
0
    void onClick_BindBtn_Btn(GameObject caster)
    {
        ActiveTakeParam par = new ActiveTakeParam();

        par.type = ActiveTakeType.Bind;
        DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.ActiveTakePanel, data: par);
    }
Beispiel #3
0
 protected override void OnShow(object data)
 {
     base.OnShow(data);
     if (data != null && data is ActiveTakeParam)
     {
         ActiveTakeParam par = (ActiveTakeParam)data;
         if (par.type == ActiveTakeType.Daily)
         {
             InitPanel((ActiveTakeParam)data);
         }
         else
         {
             m_label_VerifyBtnLabel.text = ColorManager.GetColorString(ColorType.JZRY_Txt_Black, "获取验证码");
             DataManager.Manager <DailyManager>().OnUpdateTimeEvent = OnUpdateTime;
             InitBind();
         }
         m_trans_DailyRewardContent.gameObject.SetActive(par.type == ActiveTakeType.Daily);
         m_trans_BindPhoneContent.gameObject.SetActive(par.type == ActiveTakeType.Bind);
     }
 }
Beispiel #4
0
    void InitPanel(ActiveTakeParam data)
    {
        m_label_Title.text = "活跃领取";
        boxID = data.boxID;
        DailyAwardDataBase awardData = GameTableManager.Instance.GetTableItem <DailyAwardDataBase>(boxID);

        m_label_Des_Label.text = string.Format(DataManager.Manager <TextManager>().GetLocalText(LocalTextType.Local_Txt_Daily_BoxTips), awardData.liveness);
        m_lst_UIItemRewardDatas.Clear();
        if (awardData.Exp > 0)
        {
            m_lst_UIItemRewardDatas.Add(new UIItemRewardData()
            {
                itemID = 60006,
                num    = awardData.Exp,
            });
        }
        if (awardData.gold > 0)
        {
            m_lst_UIItemRewardDatas.Add(new UIItemRewardData()
            {
                itemID = 60001,
                num    = awardData.gold,
            });
        }
        if (awardData.ticket > 0)
        {
            m_lst_UIItemRewardDatas.Add(new UIItemRewardData()
            {
                itemID = 60002,
                num    = awardData.ticket,
            });
        }
        string[] items = awardData.awarditem.Split(';');

        for (int i = 0; i < items.Length; i++)
        {
            string[] item = items[i].Split("_".ToCharArray());
            uint     itemID;
            uint     num = 1;
            if (uint.TryParse(item[0], out itemID))
            {
                table.ItemDataBase itemdata = GameTableManager.Instance.GetTableItem <ItemDataBase>(itemID);
                if (itemdata != null)
                {
                    if (uint.TryParse(item[1], out num))
                    {
                        m_lst_UIItemRewardDatas.Add(new UIItemRewardData()
                        {
                            itemID = itemdata.itemID,
                            num    = num,
                        });
                    }
                    else
                    {
                        m_lst_UIItemRewardDatas.Add(new UIItemRewardData()
                        {
                            itemID = itemdata.itemID,
                            num    = 1,
                        });
                    }
                }
                else
                {
                    Engine.Utility.Log.Info("宝箱奖励的道具ID配置有误!");
                }
            }
        }

        m_ctor_UIItemRewardCreator.CreateGrids(m_lst_UIItemRewardDatas.Count);

        if (!data.ids.Contains(boxID))
        {
            if (data.canGetState == 1)
            {
                m_btn_btn_Take.isEnabled = true;
                m_btn_btn_Take.transform.GetComponentInChildren <UILabel>().text = "领取";
            }
            else if (data.canGetState == 2)
            {
                m_btn_btn_Take.isEnabled = false;
                m_btn_btn_Take.transform.GetComponentInChildren <UILabel>().text = "已领取";
            }
            else
            {
                m_btn_btn_Take.isEnabled = false;
                m_btn_btn_Take.transform.GetComponentInChildren <UILabel>().text = "领取";
            }
        }
        else
        {
            m_btn_btn_Take.isEnabled = false;
            m_btn_btn_Take.transform.GetComponentInChildren <UILabel>().text = "已领取";
        }
    }