public override void Clean() { Data = null; if (Data == null) { SuitIcon.gameObject.SetActive(false); LockBG.SetActive(false); EquipmentIcon.spriteName = ""; LevelLabel.gameObject.SetActive(false); SetAddIconObj(false); Frame.gameObject.SetActive(false); FxObj.SetActive(false); return; } }
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); } } }
/// <summary> /// 添加单个装备 /// </summary> /// <param name="data"></param> private BaseEquipmentInfo AddOneEquipToList(object data) { if (data == null) { //EB.Debug.LogError("data is nil!");伙伴存在没装备的情况 return(null); } string key = EB.Dot.String("economy_id", data, null); if (string.IsNullOrEmpty(key)) { EB.Debug.LogError("key is nil!"); return(null); } string Temp = EB.Dot.String("system", data, null); if (Temp != "Equipment" && !EquipUpItemDic.ContainsKey(key)) { return(null); } BaseEquipmentInfo info = new BaseEquipmentInfo(); info.Eid = EB.Dot.Integer("inventory_id", data, info.Eid); info.ECid = EB.Dot.String("economy_id", data, info.ECid); info.Num = EB.Dot.Integer("num", data, info.Num); info.EquipLevel = EB.Dot.Integer("currentLevel", data, info.EquipLevel); if (EquipUpItemDic.ContainsKey(info.ECid)) { info.IconName = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetGeneral(info.ECid).IconId; addEquipUpItemNum(info.ECid); } else { info.IconName = EB.Dot.String("iconId", data, null); } string location = EB.Dot.String("location", data, null); switch (location) { case "equipment": { info.isDress = true; }; break; default: { info.isDress = false; }; break; } info.isLock = EB.Dot.Bool("lock", data, info.isLock); info.QualityLevel = EB.Dot.Integer("qualityLevel", data, info.QualityLevel); info.CellPos = EB.Dot.String("cell", data, null); string EquipTypeStr = EB.Dot.String("equipment_type", data, null); switch (EquipTypeStr) { case "1": info.Type = EquipPartType.part1; break; case "2": info.Type = EquipPartType.part2; break; case "3": info.Type = EquipPartType.part3; break; case "4": info.Type = EquipPartType.part4; break; case "5": info.Type = EquipPartType.part5; break; case "6": info.Type = EquipPartType.part6; break; default: info.Type = EquipPartType.none; break; } if (info.isDress == false && info.SuitType != -1) { if (SuitTypeAndCountDicWithoutEquiped.ContainsKey(info.SuitType)) { SuitTypeAndCountDicWithoutEquiped[info.SuitType] += 1; } else { SuitTypeAndCountDicWithoutEquiped.Add(info.SuitType, 1); } if (SuitTypeAndCountDicWithoutEquiped.ContainsKey(-1)) { SuitTypeAndCountDicWithoutEquiped[-1] += 1; } else { SuitTypeAndCountDicWithoutEquiped.Add(-1, 1); } } if (info.SuitType != -1) { if (SuitTypeAndCountDic.ContainsKey(info.SuitType)) { SuitTypeAndCountDic[info.SuitType] += 1; } else { SuitTypeAndCountDic.Add(info.SuitType, 1); } if (SuitTypeAndCountDic.ContainsKey(-1)) { SuitTypeAndCountDic[-1] += 1; } else { SuitTypeAndCountDic.Add(-1, 1); } } return(info); }