少年修仙传客户端代码仓库
leonard Wu
2018-08-03 c2d2d5d3a840bf50968b3f95e304929bc62a7b70
System/KnapSack/Logic/EquipTip.cs
@@ -34,6 +34,11 @@
        Text dateText;
        [SerializeField]
        ItemCell itemCell;
        [SerializeField]
        Text realmTitleText;
        [SerializeField] Image realmImg;
        #endregion
        #region MidUI
@@ -148,6 +153,19 @@
        {
            bottomPart.gameObject.SetActive(false);
            StartCoroutine(SetScrollSize());
            StartCoroutine(CheckPlayerIsReborn());
        }
        IEnumerator CheckPlayerIsReborn()
        {
            int questTimes = 0;
            while (questTimes < 5)
            {
                DesignDebug.Log("CheckPlayerIsReborn:开始");
                yield return new WaitForSeconds(1);
                questTimes += 1;
                DesignDebug.Log("CheckPlayerIsReborn:结束");
            }
        }
        IEnumerator SetScrollSize()
@@ -210,42 +228,8 @@
            equipScoreDes.text = Language.Get("EquipWin_EquipPointText_1");
            equipScoreValue.text = itemAttrData.score.ToString();
            RefreshNeedPointUI();
            needLvDes.text = Language.Get("KnapS110");
            if (itemAttrData.itemConfig.UseLV > 1)
            {
                needLvDes.gameObject.SetActive(true);
                needLvValue.gameObject.SetActive(true);
            }
            else
            {
                needLvDes.gameObject.SetActive(false);
                needLvValue.gameObject.SetActive(false);
            }
            if(itemAttrData.isHavePutLimit)
            {
                needLvValue.text = itemAttrData.itemConfig.UseLV.ToString();
                if (PlayerDatas.Instance.baseData.LV >= itemAttrData.itemConfig.UseLV)
                {
                    needLvDes.color = conditionColor;
                    needLvValue.color = conditionColor;
                }
                else
                {
                    needLvDes.color = UIHelper.GetUIColor(TextColType.Red);
                    needLvValue.color = UIHelper.GetUIColor(TextColType.Red);
                }
            }
            else
            {
                needLvValue.text = 1.ToString();
                needLvDes.color = conditionColor;
                needLvValue.color = conditionColor;
            }
            CheckUselimit();
            if (itemAttrData.itemConfig.ExpireTime > 0)
            {
@@ -302,6 +286,87 @@
            #endregion
        }
        private void CheckUselimit()
        {
            int[] uselimits = itemAttrData.itemConfig.UseCondiType;
            if (uselimits == null) return;
            needLvValue.gameObject.SetActive(false);
            needLvDes.gameObject.SetActive(false);
            realmTitleText.gameObject.SetActive(false);
            realmImg.gameObject.SetActive(false);
            for(int i = 0; i < needPointTextlist.Count;i++)
            {
                needPointTextlist[i].gameObject.SetActive(false);
                needPointNumlist[i].gameObject.SetActive(false);
            }
            for (int i = 0; i < uselimits.Length; i++)
            {
                switch (uselimits[i])
                {
                    case 0:
                        if (itemAttrData.itemConfig.UseLV > 1)
                        {
                            needLvValue.gameObject.SetActive(true);
                            needLvDes.gameObject.SetActive(true);
                        }
                        needLvDes.text = Language.Get("KnapS110");
                        if (itemAttrData.isHavePutLimit)
                        {
                            needLvValue.text = itemAttrData.itemConfig.UseLV.ToString();
                            if (PlayerDatas.Instance.baseData.LV >= itemAttrData.itemConfig.UseLV)
                            {
                                needLvValue.color = conditionColor;
                                needLvDes.color = conditionColor;
                            }
                            else
                            {
                                needLvValue.color = UIHelper.GetUIColor(TextColType.Red);
                                needLvDes.color = UIHelper.GetUIColor(TextColType.Red);
                            }
                        }
                        else
                        {
                            needLvValue.text = 1.ToString();
                            needLvDes.color = conditionColor;
                            needLvValue.color = conditionColor;
                        }
                        break;
                    case 1:
                        realmTitleText.gameObject.SetActive(true);
                        realmImg.gameObject.SetActive(true);
                        realmTitleText.text = Language.Get("RealmLimit1");
                        RealmConfig realmConfig = ConfigManager.Instance.GetTemplate<RealmConfig>(itemAttrData.itemConfig.RealmLimit);
                        if (itemAttrData.itemConfig.RealmLimit <= 0)
                        {
                            realmImg.SetSprite("NoRealm");
                        }
                        else
                        {
                            if (realmConfig != null)
                            {
                                realmImg.SetSprite(realmConfig.Img);
                            }
                        }
                        if (PlayerDatas.Instance.baseData.realmLevel >= itemAttrData.itemConfig.RealmLimit)
                        {
                            realmTitleText.color = conditionColor;
                        }
                        else
                        {
                            realmTitleText.color = UIHelper.GetUIColor(TextColType.Red);
                        }
                        break;
                    case 2:
                        RefreshNeedPointUI();
                        break;
                }
            }
        }
        private void OnDisable()
        {
            suirAttrCtrl.OnRefreshCell -= RefreshSuitProCell;