Example #1
0
        // ================== 已装备属性 ==================

        public void ShowEquippedInfo(int[] eids)
        {
            if (eids == null)
            {
                return;
            }

            var attr = new HeroEquipmentTotleAttr();

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

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

                    if (info == null)
                    {
                        continue;
                    }

                    attr.AddSuitInfo(info);
                }
            }

            ShowEquippedSuitView(attr.SuitList);
            ShowEquippedAttr(attr);
        }
Example #2
0
        public void Refresh()
        {
            _showCompareInfo          = !_isEditing && _equipmentPresetController.EquippedPresetItem != null && _equipmentPresetController.EquippedPresetItem != _equipmentPresetController.CurrentEquipmentPresetItem;
            CurrentEquipmentTotalAttr = new HeroEquipmentTotleAttr();

            if (_showCompareInfo)
            {
                ShowEquippedInfo(_equipmentPresetController.EquippedPresetItem.KVP.Value.eids);
            }

            //为了显示套装特效,这里需提前把数据归拢
            for (int i = 0; i < Eids.Length; i++)
            {
                int eid = Eids[i];

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

                    if (info != null)
                    {
                        CurrentEquipmentTotalAttr.AddSuitInfo(info);
                    }
                }
            }

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

                if (eid == 0)
                {
                    _equipInfoCells[i].Fill(null);
                }
                else
                {
                    DetailedEquipmentInfo info = LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(eid);

                    if (info == null)
                    {
                        EB.Debug.LogError("LTPartnerEquipmentInfoController.Show info is null, Eid = {0}", eid);
                        continue;
                    }

                    _equipInfoCells[i].Fill(info);
                }
            }

            TypeSelect();

            if (mDMono.gameObject.activeSelf)
            {
                StartCoroutine(ChangeCurrentAttrColor(isChangeColor));
            }

            for (int i = 0; i < CurrentEquipmentTotalAttr.SuitList.Count; i++)
            {
                Data.SuitTypeInfo info = Data.EconemyTemplateManager.Instance.GetSuitTypeInfoByEcidSuitType(CurrentEquipmentTotalAttr.SuitList[i].SuitType);

                if (CurrentEquipmentTotalAttr.SuitList[i].SuitType == isSuitTypeShow)
                {
                    if (CurrentEquipmentTotalAttr.SuitList[i].count == 4 && isSuitTextShow && info.SuitAttr4 != 0 || CurrentEquipmentTotalAttr.SuitList[i].count == 2 && isSuitTextShow && info.SuitAttr2 != 0)
                    {
                        for (int j = 0; j < _rightSuitFxTweeners.Length; ++j)
                        {
                            _rightSuitFxTweeners[j].tweenFactor = 0;
                            _rightSuitFxTweeners[j].PlayForward();
                        }

                        StartCoroutine(PlayShowSuitItem());
                    }
                }
            }

            ShowCurrentSuitView(CurrentEquipmentTotalAttr.SuitList);
            isSuitTextShow = false;
            isChangeColor  = false;
            ShowCompareInfo(_showCompareInfo);
        }
Example #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");
            }
        }