Esempio n. 1
0
    private void GreatItem(MailItemData mailItem, int isReceive)
    {
        m_Cell = UniversalItemCell.GenerateItem(EmailFuJianList.transform);

        int type   = mailItem.m_objectid / 1000000;
        int itemid = mailItem.m_objectid;//掉落物ID

        m_Cell.SetCheckClaim(isReceive == 1, "");

        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, mailItem.m_dropnum);
                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, mailItem.m_dropnum);
                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, mailItem.m_dropnum);
                m_Cell.SetText(GameUtils.getString(hero.getTitleID()), "", "");
            }
        }
        break;

        default:
            break;
        }
    }
Esempio n. 2
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="dayX">初始化的累计奖励提示是第几天的(1-28)</param>
        /// <param name="today">今天是第几天</param>
        public void Init(int dayX, int today, int awardId, int count)
        {
            int _dayOffset = dayX - today;

            m_Cell.InitByID(awardId, count);
            m_Cell.SetHightLight(dayX == today);

            m_Cell.SetCheckClaim(_dayOffset < 0);
            m_Cell.SetItemGray(_dayOffset < 0);

            m_Cell.SetText(string.Format(GameUtils.getString("sign_content3"), dayX), null, null);
        }
Esempio n. 3
0
        public void Init(string tittleText, int awardId, int count, bool isContinuous, bool isClaimed = false)
        {
            m_Cell.InitByID(awardId, count);
            m_Cell.SetCheckClaim(isClaimed);
            if (isContinuous)
            {
                m_AwardTittleText.gameObject.SetActive(false);
                m_DayText.gameObject.SetActive(true);
                m_DayText.text = tittleText;
            }
            else
            {
                m_AwardTittleText.gameObject.SetActive(true);
                m_DayText.gameObject.SetActive(false);
                m_AwardTittleText.text = tittleText;
            }

            m_AwardNameText.text = UI_SignInManager.GetAwardName(awardId);
        }
    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);
            }
        }
    }