Beispiel #1
0
 private void Init()
 {
     isHaveEquip = false;
     SuitType.gameObject.CustomSetActive(eid != 0);
     if (eid == 0)
     {
         SetEquipActive(false);
         SuitEffect.CustomSetActive(false);
         LockObj.CustomSetActive(false);
         LevelBG.gameObject.CustomSetActive(false);
         IconBG.CustomSetActive(true);
         if (partnerData.HeroId <= 0)
         {
             SetAddIconObj(false);
         }
         else
         {
             isHaveEquip = IsHaveEquip();
             SetAddIconObj(isHaveEquip);
         }
     }
     else
     {
         SetEquipActive(true);
         SetAddIconObj(false);
         IconBG.CustomSetActive(false);
         DetailedEquipmentInfo info = LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(eid);
         if (info == null)
         {
             EB.Debug.LogError("LTPartnerEquipItemController.Init info is null");
             return;
         }
         SetIcon(info.IconName);
         SetFrame(info.QualityLevel);
         SetSuit(info);
     }
 }
Beispiel #2
0
        public override void Fill(DetailedEquipmentInfo itemData)
        {
            if (itemData == null || itemData.Eid == 0)
            {
                Data = null;
                SuitIcon.gameObject.SetActive(false);
                LockBG.SetActive(false);
                EquipmentIcon.spriteName = "";
                LevelLabel.gameObject.SetActive(false);
                IconBG.CustomSetActive(true);
                SetAddIconObj(IsHaveEquip);
                Frame.gameObject.SetActive(false);
                FxObj.SetActive(false);
                return;
            }
            else
            {
                SuitIcon.gameObject.SetActive(true);
                IconBG.CustomSetActive(false);
                Data = itemData;
            }

            EquipmentIcon.spriteName = Data.IconName;
            LockBG.SetActive(Data.isLock);
            SetFrame(Data.QualityLevel);
            Frame.gameObject.SetActive(true);
            SuitIcon.spriteName = Data.SuitIcon;//LTPartnerEquipConfig.SuitIconDic[Data.SuitType];

            if (Data.EquipLevel > 0)
            {
                LevelLabel.text = string.Format("+{0}", Data.EquipLevel);
                LevelLabel.transform.GetChild(0).GetComponent <UISprite>().spriteName = UIItemLvlDataLookup.GetEquipLevelBGStr(Data.QualityLevel);
                LevelLabel.gameObject.SetActive(true);
            }
            else
            {
                LevelLabel.gameObject.SetActive(false);
            }

            SetAddIconObj(false);
            FxObj.SetActive(false);
            int count = (Hotfix_LT.Data.EconemyTemplateManager.Instance.GetSuitTypeInfoByEcidSuitType(Data.SuitType).SuitAttr2 != 0) ? 2 : 4;//套装件数
            List <SuitAttrsSuitTypeAndCount> suitList;

            if (LTPartnerEquipMainController.instance.CurrentEquipmentViewState == LTPartnerEquipMainController.EquipmentViewState.PresetEditView ||
                LTPartnerEquipMainController.instance.CurrentEquipmentViewState == LTPartnerEquipMainController.EquipmentViewState.PresetView)
            {
                suitList = LTPartnerEquipmentInfoController.instance.CurrentEquipmentTotalAttr.SuitList;
            }
            else
            {
                suitList = LTPartnerEquipMainController.CurrentPartnerData.EquipmentTotleAttr.SuitList;
            }

            for (int i = 0; i < suitList.Count; i++)
            {
                if (suitList[i].SuitType == Data.SuitType && suitList[i].count >= count)
                {
                    FxObj.SetActive(true);
                }
            }
        }