Beispiel #1
0
        public void Show(SuitAttrsSuitTypeAndCount itemData)
        {
            if (itemData == null)
            {
                SData = new Data.SuitTypeInfo();
                data  = itemData; mDMono.gameObject.SetActive(false);
                MainIcon.spriteName = null;
                NumLabel.text       = NumLabel.transform.GetChild(0).GetComponent <UILabel>().text = null;
                return;
            }

            data  = itemData;
            SData = Data.EconemyTemplateManager.Instance.GetSuitTypeInfoByEcidSuitType(data.SuitType);
            MainIcon.spriteName = Data.EconemyTemplateManager.Instance.GetSuitTypeInfoByEcidSuitType(itemData.SuitType).SuitIcon;//装备角标LTPartnerEquipConfig.SuitIconDic[SData.SuitType];
            NumLabel.text       = NumLabel.transform.GetChild(0).GetComponent <UILabel>().text = "[42fe79]" + itemData.count.ToString();
            mDMono.gameObject.SetActive(true);
        }
Beispiel #2
0
        public void AddSuitInfo(DetailedEquipmentInfo info)
        {
            bool unFind = true;

            for (int j = 0; j < this.SuitList.Count; j++)
            {
                if (info.SuitType == this.SuitList[j].SuitType)
                {
                    this.SuitList[j].count += 1;
                    unFind = false;
                    break;
                }
            }
            if (unFind)
            {
                SuitAttrsSuitTypeAndCount mTemp = new SuitAttrsSuitTypeAndCount(info.SuitType);
                this.SuitList.Add(mTemp);
            }
            switch (info.MainAttributes.Name)
            {
            case "ATK": this.ATK += info.MainAttributes.Value; break;

            case "MaxHP": this.MaxHP += info.MainAttributes.Value; break;

            case "DEF": this.DEF += info.MainAttributes.Value; break;

            case "CritP": this.CritP += info.MainAttributes.Value; break;

            case "CritV": this.CritV += info.MainAttributes.Value; break;

            case "ChainAtk": this.ChainAtk += info.MainAttributes.Value; break;

            case "SpExtra": this.SpExtra += info.MainAttributes.Value; break;

            case "SpRes": this.SpRes += info.MainAttributes.Value; break;

            case "MaxHPrate": this.MaxHPrate += info.MainAttributes.Value; break;

            case "ATKrate": this.ATKrate += info.MainAttributes.Value; break;

            case "DEFrate": this.DEFrate += info.MainAttributes.Value; break;

            case "Speed": this.Speed += info.MainAttributes.Value; break;

            case "speedrate": this.Speedrate += info.MainAttributes.Value; break;

            default: EB.Debug.LogWarning("Equipment MainAttribute Miss{0}", info.MainAttributes.Name); break;
            }
            for (int j = 0; j < info.ExAttributes.Count; j++)
            {
                switch (info.ExAttributes[j].Name)
                {
                case "ATK": this.ATK += info.ExAttributes[j].Value; break;

                case "MaxHP": this.MaxHP += info.ExAttributes[j].Value; break;

                case "DEF": this.DEF += info.ExAttributes[j].Value; break;

                case "CritP": this.CritP += info.ExAttributes[j].Value; break;

                case "CritV": this.CritV += info.ExAttributes[j].Value; break;

                case "ChainAtk": this.ChainAtk += info.ExAttributes[j].Value; break;

                case "SpExtra": this.SpExtra += info.ExAttributes[j].Value; break;

                case "SpRes": this.SpRes += info.ExAttributes[j].Value; break;

                case "MaxHPrate": this.MaxHPrate += info.ExAttributes[j].Value; break;

                case "ATKrate": this.ATKrate += info.ExAttributes[j].Value; break;

                case "DEFrate": this.DEFrate += info.ExAttributes[j].Value; break;

                case "Speed": this.Speed += info.ExAttributes[j].Value; break;

                case "speedrate": this.Speedrate += info.ExAttributes[j].Value; break;

                default: EB.Debug.LogWarning("Equipment ExAttribute Miss{0}", info.ExAttributes[j].Name); break;
                }
            }
        }
Beispiel #3
0
        public void SetData(bool isEquipped, KeyValuePair <string, EquipmentPresetModel> kvp)
        {
            KVP = kvp;
            SetName(kvp.Key);
            SetEquipped(isEquipped);
            SetHighlight(isEquipped);

            var attr = new HeroEquipmentTotleAttr();

            for (int i = 0; i < kvp.Value.eids.Length; i++)
            {
                int eid = kvp.Value.eids[i];

                if (eid != 0)
                {
                    DetailedEquipmentInfo info = LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(eid);

                    if (info == null)
                    {
                        continue;
                    }

                    attr.AddSuitInfo(info);
                }
            }

            SuitAttrsSuitTypeAndCount data = null;
            int twoPieceSuitCount          = 0;

            for (int i = 0; i < attr.SuitList.Count; i++)
            {
                if (data == null)
                {
                    data = attr.SuitList[i];
                }
                else if (attr.SuitList[i].count > data.count)
                {
                    data = attr.SuitList[i];
                }

                if (data.count >= 2)
                {
                    twoPieceSuitCount += 1;
                }
            }

            var suitTypeInfo = data != null?Data.EconemyTemplateManager.Instance.GetSuitTypeInfoByEcidSuitType(data.SuitType) : null;

            if (data != null && data.count >= 4 && suitTypeInfo != null && suitTypeInfo.SuitAttr4 != 0)
            {
                SetIcon(suitTypeInfo.SuitIcon);
            }
            else if (twoPieceSuitCount == 1 && data != null && data.count >= 2 && suitTypeInfo != null && suitTypeInfo.SuitAttr2 != 0)
            {
                SetIcon(suitTypeInfo.SuitIcon);
            }
            else
            {
                SetIcon("Equipment_Icon_Taozhuang");
            }
        }