Esempio n. 1
0
    void UpdateTickBand()
    {
        m_curTimer += Time.deltaTime;
        if (m_curTimer < 1)
        {
            return;
        }

        m_curTimer = 0;
        // 背包物品同步无法做到进化后立即获取,所以在Update里更新。
        if (GameManager.gameManager.PlayerDataPool == null)
        {
            return;
        }
        Games.Item.GameItemContainer backPack = GameManager.gameManager.PlayerDataPool.BackPack;
        if (backPack == null)
        {
            return;
        }
        //         int evoItemCount = backPack.GetItemCountByDataId(28);
        //         labelEvoItemCount.text = StrDictionary.GetClientDictionaryString("#{3231}", evoItemCount);
        UpdateButtonState();
        if (!m_btnClose.isEnabled)
        {
            Utils.SetTimeDiffToLabel(m_btnCLoseLable, BelleData.GetBelleCloseTimeDiff());
        }

        //Utils.SetTimeDiffToLabel(labelNextEvolutionTimeValue, EvolutionTimeDiff());
    }
Esempio n. 2
0
        /// <summary>
        /// 过滤出需要类型的物品
        /// </summary>
        /// <param name="Container"></param>
        /// <param name="nClass"></param>
        /// <param name="nSubClass"></param>
        /// <returns></returns>
        static public List <GameItem> ItemFilter(GameItemContainer Container, int nClass, int nSubClass = 0, bool isQianKunDai = false, int nMin = -1, int nCount = -1)
        {
            List <GameItem> resultlist = new List <GameItem>();
            int             nItemCount = 0;

            for (int nIndex = 0; nIndex < Container.ContainerSize; ++nIndex)
            {
                GameItem item = Container.GetItem(nIndex);
                if (item.IsValid())
                {
                    Tab_CommonItem tabItem = TableManager.GetCommonItemByID(item.DataID, 0);
                    if (null != tabItem)
                    {
                        int itemclass    = tabItem.ClassID;
                        int itemsubclass = tabItem.SubClassID;
                        if ((itemclass == nClass || nClass == 0) &&
                            (itemsubclass == nSubClass || nSubClass == 0) &&
                            ((tabItem.IsCanQianKunDai == 1 && isQianKunDai) || !isQianKunDai))
                        {
                            resultlist.Add(item);
                            nItemCount++;
                        }
                    }
                }
            }
            if (nMin < 0 || nCount < 0 || nMin >= nItemCount)
            {
                return(ItemSort(resultlist));
            }
            else
            {
                List <GameItem> retList   = ItemSort(resultlist);
                int             leftCount = nItemCount - nMin;
                if (leftCount < nCount)
                {
                    return(retList.GetRange(nMin, leftCount));
                }
                else
                {
                    return(retList.GetRange(nMin, nCount));
                }
            }
        }
Esempio n. 3
0
    public void UpdateEvalutionInfo()
    {
        if (null == BelleInfoWindow.Instance())
        {
            return;
        }

        Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

        if (null == belleTab)
        {
            return;
        }

        Belle curBelleData = null;

        if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
        {
            curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
        }
        if (null == curBelleData)
        {
            return;
        }
        int belleSubItemId     = belleTab.BelleItemID;
        int belleTotalSubCount = 0;
        int belleCoinCount     = 0;
        Tab_BelleLevelup curTabBelleLevelup = TableManager.GetBelleLevelupByID(curBelleData.id * Belle.ID_FACTOR + curBelleData.orgLevel, 0);

        if (null != curTabBelleLevelup && curTabBelleLevelup.getConsumeTypeCount() > 0)
        {
            belleTotalSubCount = curTabBelleLevelup.GetConsumeNumbyIndex(0);
            belleCoinCount     = curTabBelleLevelup.GetConsumeNumbyIndex(1);
        }

        if (GameManager.gameManager.PlayerDataPool == null)
        {
            return;
        }
        Games.Item.GameItemContainer backPack = GameManager.gameManager.PlayerDataPool.BackPack;
        if (backPack == null)
        {
            return;
        }
        int belleSubItemCount = backPack.GetItemCountByDataId(belleSubItemId);
        int have = 0; int need = 0;

        GetBelleFragmentNum(out have, out need);
        m_curBelleItemCount.text = have.ToString() + "/" + need.ToString();
        if (need > 0)
        {
            BelleFragmentUS.transform.localScale = new Vector3((float)have / need, 1f, 1f);
        }
        Tab_CommonItem commItem = TableManager.GetCommonItemByID(belleTab.BelleItemID, 0);

        if (commItem != null)
        {
            m_curBelleItemIcon.spriteName = commItem.Icon;
        }
        if (belleSubItemCount < belleTotalSubCount)
        {
            m_curBelleEvaluteLab.text = StrDictionary.GetClientDictionaryString("#{10812}");
            messageBtn.functionName   = "OnGetItem";
            evoRedTipObj.gameObject.SetActive(false);
            if (BelleConfig.GetBelleEvoBitByIndex(belleTab.Id))
            {
                BelleConfig.SetBelleEvoCountByBit(belleTab.Id, '0');
            }
        }
        else
        {
            m_curBelleEvaluteLab.text = StrDictionary.GetClientDictionaryString("#{10813}");
            messageBtn.functionName   = "OnEvolutionClick";
            evoRedTipObj.gameObject.SetActive(!curBelleData.IsMaxLevel());
        }

        BelleData.m_belleEvoCount = BelleConfig.GetBelleEvoCount();
        //最大等级的一个判断


        m_EvaluBtnObj.SetActive(!curBelleData.IsMaxLevel());
        m_EvaluMaxLabel.gameObject.SetActive(curBelleData.IsMaxLevel());
    }