Esempio n. 1
0
    public void SetRewardItem(int nItemID, RewardAwardItem.ItemType type, int nCount, ref int nItemIndex)
    {
        //m_RewardItem.AddItem(nItemType,nItemID,nItemCount,itemIndex,(int)DaySignInStates.NOTSIGNEN,vipLevel);

        Tab_CommonItem    tabItem = null;
        MissionRewardItem item    = m_RewardItem[nItemIndex];

        switch (type)
        {
        case RewardAwardItem.ItemType.ITEM_EXP:
            item.sprIcon.spriteName = "jingyan";
            break;

        case RewardAwardItem.ItemType.ITEM_MONEY:
            item.sprIcon.spriteName = "jinbi";
            break;

        case RewardAwardItem.ItemType.ITEM_YUANBAO:
            item.sprIcon.spriteName = "bdyuanbao";
            break;

        case RewardAwardItem.ItemType.ITEM_ITEM:
            tabItem = TableManager.GetCommonItemByID(nItemID, 0);
            if (tabItem == null)
            {
                nItemIndex = nItemIndex - 1;
                return;
            }
            item.sprIcon.spriteName         = tabItem.Icon;
            item.sprQualityFrame.spriteName = GlobeVar.QualityColorGrid[tabItem.Quality - 1];
            break;
        }
        UIEventListener.Get(item.gameObject).onClick = ShowRewardDetail;
        item.gameObject.SetActive(true);
        item.itemType      = (int)type;
        item.itemId        = nItemID;
        item.itemCount     = nCount;
        item.lblCount.text = nCount.ToString();
        item.sprQualityFrame.spriteName = GlobeVar.QualityColorGrid[0];
        //if (type == RewardAwardItem.ItemType.ITEM_ITEM)
        //{

        //}
    }
Esempio n. 2
0
    public void AddItem(RewardAwardItem.ItemType nItemType, int nItemID, int nItemCount, int itemIndex = 0, int itemStatus = 0, int vipLevel = 0, IChooseItem ins = null, Action sureAction = null, bool isDefaultCanDoSign = false)
    {
        m_RewardItem.AddItem(nItemType, nItemID, nItemCount, itemIndex, (int)DaySignInStates.NOTSIGNEN, vipLevel);
        if (sureAction != null)
        {
            m_SureAction = sureAction;
        }
        Tab_CommonItem tabItem = TableManager.GetCommonItemByID(nItemID, 0);

        if (tabItem != null)
        {
            m_lblItemName.text = tabItem.Name;
        }
        else
        {
            switch (nItemType)
            {
            case RewardAwardItem.ItemType.ITEM_MONEY:
                m_lblItemName.text = StrDictionary.GetClientDictionaryString("#{10921}");
                break;

            case RewardAwardItem.ItemType.ITEM_EXP:
                m_lblItemName.text = StrDictionary.GetClientDictionaryString("#{10849}");
                break;

            case RewardAwardItem.ItemType.ITEM_YUANBAO:
                m_lblItemName.text = StrDictionary.GetClientDictionaryString("#{2913}");
                break;

            default:
                m_lblItemName.text = "";
                break;
            }
        }

        if (AwardLogic.Instance() == null || AwardLogic.Instance().m_DaySignInAwardRoot == null)
        {
            return;
        }

        DaySignInItem Signitem = AwardLogic.Instance().m_DaySignInAwardRoot.GetDaySignInItemWithIndex(itemIndex);

        if (vipLevel > 0)
        {
            //达到VIP{0}可补领额外奖励
            if ((DaySignInStates)itemStatus == DaySignInStates.NOTSIGNEN)
            {
                m_ConditionStr = StrDictionary.GetClientDictionaryString("#{11239}", vipLevel);
                m_BtnStr       = StrDictionary.GetClientDictionaryString("#{4638}");
            }
            //显示达到vipxx 奖励翻倍
            else if ((DaySignInStates)itemStatus == DaySignInStates.NORMALSIGNED ||
                     (DaySignInStates)itemStatus == DaySignInStates.VIPSIGNEDHALF)
            {
                m_ConditionStr = StrDictionary.GetClientDictionaryString("#{11240}", Signitem.vipLimit);
                m_BtnStr       = StrDictionary.GetClientDictionaryString("#{4638}");
            }
        }
        //消费xxx点券可以补签
        else
        {
            //当前是默认可签到的第一个
            if (isDefaultCanDoSign)
            {
                m_ConditionStr = "";
            }
            else
            {
                m_ConditionStr = StrDictionary.GetClientDictionaryString("#{4703}", Signitem.SupplyCost);
            }
            m_BtnStr = StrDictionary.GetClientDictionaryString("#{4638}");
        }
        ShowUIDuePopUpType();
        gameObject.SetActive(true);
    }