コード例 #1
0
    /// <summary>
    /// 刷新BannerItem 是否显示已领取字样
    /// </summary>
    /// <param name="_ActivityItem"></param>
    /// <param name="_id"></param>
    public void RefreshItem(ActivityItem _ActivityItem, int _id)
    {
        GameactivityTemplate _Data = (GameactivityTemplate)DataTemplate.GetInstance().m_GameactivityTable.getTableData(_id);
        int _allnum    = 0;
        int _todaynum  = 0;
        int _cangetnum = 0;

        if (m_ActivityOverviewMar.m_ActivityOverviewData.ContainsKey(_id))
        {
            _allnum    = m_ActivityOverviewMar.m_ActivityOverviewData[_id].m_allnum;
            _todaynum  = m_ActivityOverviewMar.m_ActivityOverviewData[_id].m_todaynum;
            _cangetnum = m_ActivityOverviewMar.m_ActivityOverviewData[_id].m_cangetnum;
        }
        int _Periodmax = _Data.getPeriodmax();
        int _Daymax    = _Data.getDaymax();

        if (_Periodmax == -1)
        {
            _Periodmax = 1000000;
        }
        if (_Daymax == -1)
        {
            _Daymax = 1000000;
        }
        if (_todaynum == _Daymax)
        {
            if (_cangetnum == 0)
            {
                _ActivityItem.SetReceiveOverShow(true);
            }
            else
            {
                _ActivityItem.SetReceiveOverShow(false);
            }
        }
        else
        {
            _ActivityItem.SetReceiveOverShow(false);
        }
    }
コード例 #2
0
    public void ForReceiveAward()
    {
        List <int> _tempList = m_MergeData[m_TeamId];

        for (int i = 0; i < _tempList.Count; i++)
        {
            if (m_ActivityOverviewMar.m_ActivityOverviewData[_tempList[i]].m_cangetnum > 0)
            {
                CGetGameAct _CGetGameAct = new CGetGameAct();
                _CGetGameAct.actid = _tempList[i];
                //Debug.Log(_tempList[i]);
                IOControler.GetInstance().SendProtocol(_CGetGameAct);
            }
        }

        //获取领取的所有图标的ID 用于弹框显示用
        GameactivityTemplate _Data = (GameactivityTemplate)DataTemplate.GetInstance().m_GameactivityTable.getTableData(_tempList[0]);

        if (_Data.getDaymax() == -1 && _Data.getPeriodmax() == -1)
        {
            m_PopupData_Num = m_ActivityOverviewMar.m_ActivityOverviewData[_tempList[0]].m_cangetnum;//当天,期间无限制的组中都只有一个活动
        }
    }
コード例 #3
0
    /// <summary>
    /// 按钮的显示
    /// </summary>
    // public void ReceiveButtonShow(ActivityOverviewData _ActivityOverviewData, GameactivityTemplate _GameactivityTemplate)
    public void ReceiveButtonShow()
    {
        List <int> _tempList = m_MergeData[m_TeamId];

        for (int i = 0; i < _tempList.Count; i++)
        {
            GameactivityTemplate _Data = (GameactivityTemplate)DataTemplate.GetInstance().m_GameactivityTable.getTableData(_tempList[i]);

            string[] jumpTypeArray = _Data.getJumpstype().Split('#');
            int      _allnum       = 0;
            int      _todaynum     = 0;
            int      _cangetnum    = 0;
            if (m_ActivityOverviewMar.m_ActivityOverviewData.ContainsKey(_tempList[i]))
            {
                _allnum    = m_ActivityOverviewMar.m_ActivityOverviewData[_tempList[i]].m_allnum;
                _todaynum  = m_ActivityOverviewMar.m_ActivityOverviewData[_tempList[i]].m_todaynum;
                _cangetnum = m_ActivityOverviewMar.m_ActivityOverviewData[_tempList[i]].m_cangetnum;
            }


            int _Periodmax = _Data.getPeriodmax();
            int _Daymax    = _Data.getDaymax();
            if (_Periodmax == -1)
            {
                _Periodmax = 1000000;
            }
            if (_Daymax == -1)
            {
                _Daymax = 1000000;
            }

            if (string.IsNullOrEmpty(jumpTypeArray[0]))
            {
                m_MiddleButton.gameObject.SetActive(true);
                m_LeftButton.gameObject.SetActive(false);
                m_RightButton.gameObject.SetActive(false);

                if (_todaynum <= _Daymax)
                {
                    if (_cangetnum > 0)
                    {
                        MiddleButtonLight();
                        return;
                    }
                    else
                    {
                        MiddleButtonGrey();
                    }
                }
                else
                {
                    MiddleButtonGrey();
                }
            }
            else if (int.Parse(jumpTypeArray[0]) == 1)
            {
                m_RightButtonText.text = GameUtils.getString("activity_button_n1");    // common_button_recharge  充值
            }
            else
            {
                m_RightButtonText.text = GameUtils.getString("liveness_content5");     // 前 往
            }

            if (!string.IsNullOrEmpty(jumpTypeArray[0]))
            {
                m_MiddleButton.gameObject.SetActive(false);
                m_LeftButton.gameObject.SetActive(true);
                m_RightButton.gameObject.SetActive(true);
                if (_todaynum <= _Daymax)
                {
                    if (_cangetnum > 0)
                    {
                        LeftButtonLight();
                        return;
                    }
                    else
                    {
                        LeftButtonGrey();
                    }
                }
                else
                {
                    LeftButtonGrey();
                }
            }
        }
    }
コード例 #4
0
    private void GreatItem(int _key, GameactivityTemplate _GameactivityTemplate, ActivityOverviewData _ActivityOverviewData)
    {
        m_Cell = UniversalItemCell.GenerateItem(m_IconItemParent.transform);

        int _Daymax = _GameactivityTemplate.getDaymax();

        if (_Daymax == -1)
        {
            _Daymax = 1000000;
        }

        if (_ActivityOverviewData.m_todaynum < _Daymax)
        {
            m_Cell.SetCheckClaim(false, "");
        }
        else
        {
            if (_ActivityOverviewData.m_cangetnum == 0)
            {
                m_Cell.SetCheckClaim(true, "");
            }
            else
            {
                m_Cell.SetCheckClaim(false, "");
            }
        }

        int[]    dropdestypeArray = _GameactivityTemplate.getDropdestype();
        string[] DropdesArray     = _GameactivityTemplate.getDropdes().Split('#');
        int[]    numdesArray      = _GameactivityTemplate.getNumdes();;
        string[] TextdesArray     = _GameactivityTemplate.getTextdes().Split('#');

        int _num = -1;

        if (numdesArray.Length != 0)
        {
            if (numdesArray[_key] != -1)
            {
                _num = numdesArray[_key];
            }
        }

        if (dropdestypeArray[_key] == 1)
        {
            int itemid = int.Parse(DropdesArray[_key]);

            int type = itemid / 1000000;

            switch (type)
            {
            case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_RES:
                ResourceindexTemplate _temp_res = (ResourceindexTemplate)DataTemplate.GetInstance().m_ResourceindexTemplate.getTableData(itemid);
                if (_temp_res != null)
                {
                    m_Cell.InitByID(itemid, _num);
                    m_Cell.SetText(GameUtils.getString(_temp_res.getName()), "", "");
                }
                break;

            case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_RUNE:     //符文
            {
                ItemTemplate itemTable = (ItemTemplate)DataTemplate.GetInstance().m_ItemTable.getTableData(itemid);
                if (itemTable != null)
                {
                    m_Cell.InitByID(itemid, -1);
                    m_Cell.SetText(GameUtils.getString(itemTable.getName()), "", "");
                }
            }
            break;

            case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_COMMON:
            {
                ItemTemplate itemTable = (ItemTemplate)DataTemplate.GetInstance().m_ItemTable.getTableData(itemid);
                if (itemTable != null)
                {
                    m_Cell.InitByID(itemid, _num);
                    m_Cell.SetText(GameUtils.getString(itemTable.getName()), "", "");
                }
            }
            break;

            case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_HERO:
            {
                HeroTemplate hero = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(itemid);
                if (hero != null)
                {
                    m_Cell.InitByID(itemid, _num);
                    m_Cell.SetText(GameUtils.getString(hero.getTitleID()), "", "");
                }
            }
            break;

            default:
                break;
            }
        }
        if (dropdestypeArray[_key] == 0)
        {
            m_Cell.SetText(GameUtils.getString(TextdesArray[_key]), "", "");
            if (TextdesArray[_key] != string.Empty)
            {
                Sprite sprite = UIResourceMgr.LoadSprite(common.defaultPath + TextdesArray[_key]);
                m_Cell.InitBySprite(sprite);
            }
        }
    }