/// <summary>获取最终属性</summary> private static LTAttributesData GetPartnerAllAttributesByParnterData(LTPartnerData partnerData) { //最终白字属性 LTAttributesData attrData = GetPartnerAttributesByParnterData(partnerData); //基础白字属性 LTAttributesData baseData = AttributesUtil.GetBaseAttributes(partnerData); //绿字属性 LTAttributesData equipData = GetPartnerEquipmentAttributes(baseData, partnerData.EquipmentTotleAttr); attrData.Add(equipData); return(attrData); }
private void ShowAttr() { LTAttributesData curAttrData = AttributesManager.GetPartnerAttributesByParnterData(partnerData); LTAttributesData baseAttrData = AttributesUtil.GetBaseAttributes(partnerData); LTAttributesData equipData = AttributesManager.GetPartnerEquipmentAttributes(baseAttrData, partnerData.EquipmentTotleAttr); curAttrData.Add(equipData); AttrNumLabels[0].text = Mathf.FloorToInt(curAttrData.m_ATK).ToString(); AttrNumLabels[1].text = Mathf.FloorToInt(curAttrData.m_DEF).ToString(); AttrNumLabels[2].text = Mathf.FloorToInt(curAttrData.m_MaxHP).ToString(); float num = curAttrData.m_CritP * 100; AttrNumLabels[3].text = string.Format("{0}%", num.ToString("f1")); num = curAttrData.m_CritV * 100; AttrNumLabels[4].text = string.Format("{0}%", num.ToString("f1")); AttrNumLabels[5].text = Mathf.FloorToInt(curAttrData.m_Speed).ToString(); num = curAttrData.m_SpExtra * 100; AttrNumLabels[6].text = string.Format("{0}%", num.ToString("f1")); num = curAttrData.m_SpRes * 100; AttrNumLabels[7].text = string.Format("{0}%", num.ToString("f1")); num = curAttrData.m_DamageAdd * 100; AttrNumLabels[8].text = string.Format("{0}%", num.ToString("f1")); num = curAttrData.m_DamageReduce * 100; AttrNumLabels[9].text = string.Format("{0}%", num.ToString("f1")); num = curAttrData.m_CritDef * 100; AttrNumLabels[10].text = string.Format("{0}%", num.ToString("f1")); }
public void ShowAttr() { LTAttributesData attrData = AttributesUtil.GetBaseAttributes(m_Data); HeroEquipmentTotleAttr E_Attr = m_Data.EquipmentTotleAttr; string plusStr = (E_Attr.ATK + E_Attr.ATKrate + E_Attr.SuitAttr.ATKrate) == 0 ? "" : "+"; double Temp = (attrData.m_ATK * (E_Attr.ATKrate + E_Attr.SuitAttr.ATKrate) + E_Attr.ATK); double Value = Temp - OldE_AttrValue[0]; AttrsLabel[0].text = string.IsNullOrEmpty(plusStr) ? EB.StringUtil.Format("{0}", Mathf.FloorToInt((float)Temp)) : EB.StringUtil.Format("{0}{1}", plusStr, Mathf.FloorToInt((float)Temp));//0攻击 OldE_AttrValue[0] = Temp; plusStr = (E_Attr.DEF + E_Attr.DEFrate) == 0 ? "" : "+"; Temp = (attrData.m_DEF * (E_Attr.DEFrate + E_Attr.SuitAttr.DEFrate) + E_Attr.DEF); Value = Temp - OldE_AttrValue[1]; AttrsLabel[1].text = string.IsNullOrEmpty(plusStr) ? EB.StringUtil.Format("{0}", Mathf.FloorToInt((float)Temp)) : EB.StringUtil.Format("{0}{1}", plusStr, Mathf.FloorToInt((float)Temp));//1防御 OldE_AttrValue[1] = Temp; plusStr = (E_Attr.MaxHP + E_Attr.MaxHPrate + E_Attr.SuitAttr.MaxHPrate) == 0 ? "" : "+"; Temp = (attrData.m_MaxHP * (E_Attr.MaxHPrate + E_Attr.SuitAttr.MaxHPrate) + E_Attr.MaxHP); Value = Temp - OldE_AttrValue[2]; AttrsLabel[2].text = string.IsNullOrEmpty(plusStr) ? EB.StringUtil.Format("{0}", Mathf.FloorToInt((float)Temp)) : EB.StringUtil.Format("{0}{1}", plusStr, Mathf.FloorToInt((float)Temp));//2生命 OldE_AttrValue[2] = Temp; plusStr = (attrData.m_Speed * (E_Attr.Speedrate + E_Attr.SuitAttr.Speedrate)) == 0 ? "" : "+"; Temp = (attrData.m_Speed * (E_Attr.Speedrate + E_Attr.SuitAttr.Speedrate)); Value = Temp - OldE_AttrValue[3]; AttrsLabel[3].text = string.IsNullOrEmpty(plusStr) ? EB.StringUtil.Format("{0}", Mathf.FloorToInt((float)Temp)) : EB.StringUtil.Format("{0}{1}", plusStr, Mathf.FloorToInt((float)Temp));//3速度 OldE_AttrValue[3] = Temp; plusStr = (E_Attr.CritP + E_Attr.SuitAttr.CritP) == 0 ? "" : "+"; Temp = ((E_Attr.CritP + E_Attr.SuitAttr.CritP) * 100); Value = Temp - OldE_AttrValue[4]; AttrsLabel[4].text = string.IsNullOrEmpty(plusStr) ? EB.StringUtil.Format("{0}%", Mathf.FloorToInt((float)Temp)) : EB.StringUtil.Format("{0}{1}%", plusStr, Mathf.FloorToInt((float)Temp));//4暴击 OldE_AttrValue[4] = Temp; plusStr = (E_Attr.CritV + E_Attr.SuitAttr.CritV) == 0 ? "" : "+"; Temp = ((E_Attr.CritV + E_Attr.SuitAttr.CritV) * 100); Value = Temp - OldE_AttrValue[5]; AttrsLabel[5].text = string.IsNullOrEmpty(plusStr) ? EB.StringUtil.Format("{0}%", Mathf.FloorToInt((float)Temp)) : EB.StringUtil.Format("{0}{1}%", plusStr, Mathf.FloorToInt((float)Temp));//5暴伤 OldE_AttrValue[5] = Temp; plusStr = (E_Attr.SpExtra + E_Attr.SuitAttr.SpExtra) == 0 ? "" : "+"; Temp = ((E_Attr.SpExtra + E_Attr.SuitAttr.SpExtra) * 100); Value = Temp - OldE_AttrValue[6]; AttrsLabel[6].text = string.IsNullOrEmpty(plusStr) ? EB.StringUtil.Format("{0}%", Mathf.FloorToInt((float)Temp)) : EB.StringUtil.Format("{0}{1}%", plusStr, Mathf.FloorToInt((float)Temp));//6命中 OldE_AttrValue[6] = Temp; plusStr = (E_Attr.SpRes + E_Attr.SuitAttr.SpRes) == 0 ? "" : "+"; Temp = ((E_Attr.SpRes + E_Attr.SuitAttr.SpRes) * 100); Value = Temp - OldE_AttrValue[7]; AttrsLabel[7].text = string.IsNullOrEmpty(plusStr) ? EB.StringUtil.Format("{0}%", Mathf.FloorToInt((float)Temp)) : EB.StringUtil.Format("{0}{1}%", plusStr, Mathf.FloorToInt((float)Temp));//7抵抗 OldE_AttrValue[7] = Temp; }
public void Show(LTPartnerData Data) { if (Data == null) { return; } m_Data = Data; HeroQualityIcon.spriteName = LTPartnerConfig.PARTNER_GRADE_SPRITE_NAME_DIC[(PartnerGrade)Data.HeroInfo.role_grade]; HeroNameLabel.text = Data.HeroInfo.name; PartnerInfoItem.Clean(); PartnerInfoItem.Fill(Data); for (int i = 0; i < 6; i++) { int Eid = Data.GetEquipmentsInfo(i).Eid; if (Eid == 0) { EquipmentCell[i].Fill(null); } else { DetailedEquipmentInfo info = LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(Eid); if (info == null) { EB.Debug.LogError("LTPartnerEquipPartnerInfoController.Show info is null,Eid = {0}", Eid); continue; } EquipmentCell[i].Fill(info); } } TypeSelect(); LTAttributesData attrData = AttributesUtil.GetBaseAttributes(Data); HeroEquipmentTotleAttr E_Attr = Data.EquipmentTotleAttr; if (mDMono.gameObject.activeSelf) { StartCoroutine(ColorAttrShow(isChangeColor)); } for (int k = 0; k < E_Attr.SuitList.Count; k++) { Hotfix_LT.Data.SuitTypeInfo info = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetSuitTypeInfoByEcidSuitType(E_Attr.SuitList[k].SuitType); if (E_Attr.SuitList[k].SuitType == isSuitTypeShow) { if (E_Attr.SuitList[k].count == 4 && isSuitTextShow && info.SuitAttr4 != 0 || E_Attr.SuitList[k].count == 2 && isSuitTextShow && info.SuitAttr2 != 0) { UITweener[] tweeners = SuitFxObj.GetComponents <UITweener>(); for (int j = 0; j < tweeners.Length; ++j) { tweeners[j].tweenFactor = 0; tweeners[j].PlayForward(); } StartCoroutine(PlayShowSuitItem()); } } } SuitViewShow(E_Attr.SuitList); isSuitTextShow = false; isChangeColor = false; }
public void ShowColorAttr() { LTAttributesData attrData = AttributesUtil.GetBaseAttributes(m_Data); HeroEquipmentTotleAttr E_Attr = m_Data.EquipmentTotleAttr; string plusStr = (E_Attr.ATK + E_Attr.ATKrate + E_Attr.SuitAttr.ATKrate) == 0 ? "[ffffff00]+[-]" : "+"; double Temp = (attrData.m_ATK * (E_Attr.ATKrate + E_Attr.SuitAttr.ATKrate) + E_Attr.ATK); double Value = Temp - OldE_AttrValue[0]; string colorStr = Value == 0 ? plusStr : Value < 0 ? "[ff6699]+" : "[42fe79]+"; AttrsLabel[0].text = EB.StringUtil.Format("{0}{1}", colorStr, Mathf.FloorToInt((float)Temp));//0攻击 if (Value != 0) { AttrsLabel[0].GetComponent <TweenScale>().ResetToBeginning(); AttrsLabel[0].GetComponent <TweenScale>().PlayForward(); } OldE_AttrValue[0] = Temp; plusStr = (E_Attr.DEF + E_Attr.DEFrate) == 0 ? "[ffffff00]+[-]" : "+"; Temp = (attrData.m_DEF * (E_Attr.DEFrate + E_Attr.SuitAttr.DEFrate) + E_Attr.DEF); Value = Temp - OldE_AttrValue[1]; colorStr = Value == 0 ? plusStr : Value < 0 ? "[ff6699]+" : "[42fe79]+"; AttrsLabel[1].text = EB.StringUtil.Format("{0}{1}", colorStr, Mathf.FloorToInt((float)Temp));//1防御 if (Value != 0) { AttrsLabel[1].GetComponent <TweenScale>().ResetToBeginning(); AttrsLabel[1].GetComponent <TweenScale>().PlayForward(); } OldE_AttrValue[1] = Temp; plusStr = (E_Attr.MaxHP + E_Attr.MaxHPrate + E_Attr.SuitAttr.MaxHPrate) == 0 ? "[ffffff00]+[-]" : "+"; Temp = (attrData.m_MaxHP * (E_Attr.MaxHPrate + E_Attr.SuitAttr.MaxHPrate) + E_Attr.MaxHP); Value = Temp - OldE_AttrValue[2]; colorStr = Value == 0 ? plusStr : Value < 0 ? "[ff6699]+" : "[42fe79]+"; AttrsLabel[2].text = EB.StringUtil.Format("{0}{1}", colorStr, Mathf.FloorToInt((float)Temp));//2生命 if (Value != 0) { AttrsLabel[2].GetComponent <TweenScale>().ResetToBeginning(); AttrsLabel[2].GetComponent <TweenScale>().PlayForward(); } OldE_AttrValue[2] = Temp; plusStr = (attrData.m_Speed * (E_Attr.Speedrate + E_Attr.SuitAttr.Speedrate)) == 0 ? "[ffffff00]+[-]" : "+"; Temp = (attrData.m_Speed * (E_Attr.Speedrate + E_Attr.SuitAttr.Speedrate)); Value = Temp - OldE_AttrValue[3]; colorStr = Value == 0 ? plusStr : Value < 0 ? "[ff6699]+" : "[42fe79]+"; AttrsLabel[3].text = EB.StringUtil.Format("{0}{1}", colorStr, Mathf.FloorToInt((float)Temp));//3速度 if (Value != 0) { AttrsLabel[3].GetComponent <TweenScale>().ResetToBeginning(); AttrsLabel[3].GetComponent <TweenScale>().PlayForward(); } OldE_AttrValue[3] = Temp; plusStr = (E_Attr.CritP + E_Attr.SuitAttr.CritP) == 0 ? "[ffffff00]+[-]" : "+"; Temp = ((E_Attr.CritP + E_Attr.SuitAttr.CritP) * 100); Value = Temp - OldE_AttrValue[4]; colorStr = Value == 0 ? plusStr : Value < 0 ? "[ff6699]+" : "[42fe79]+"; AttrsLabel[4].text = EB.StringUtil.Format("{0}{1}%", colorStr, Mathf.FloorToInt((float)Temp));//4暴击 if (Value != 0) { AttrsLabel[4].GetComponent <TweenScale>().ResetToBeginning(); AttrsLabel[4].GetComponent <TweenScale>().PlayForward(); } OldE_AttrValue[4] = Temp; plusStr = (E_Attr.CritV + E_Attr.SuitAttr.CritV) == 0 ? "[ffffff00]+[-]" : "+"; Temp = ((E_Attr.CritV + E_Attr.SuitAttr.CritV) * 100); Value = Temp - OldE_AttrValue[5]; colorStr = Value == 0 ? plusStr : Value < 0 ? "[ff6699]+" : "[42fe79]+"; AttrsLabel[5].text = EB.StringUtil.Format("{0}{1}%", colorStr, Mathf.FloorToInt((float)Temp));//5暴伤 if (Value != 0) { AttrsLabel[5].GetComponent <TweenScale>().ResetToBeginning(); AttrsLabel[5].GetComponent <TweenScale>().PlayForward(); } OldE_AttrValue[5] = Temp; plusStr = (E_Attr.SpExtra + E_Attr.SuitAttr.SpExtra) == 0 ? "[ffffff00]+[-]" : "+"; Temp = ((E_Attr.SpExtra + E_Attr.SuitAttr.SpExtra) * 100); Value = Temp - OldE_AttrValue[6]; colorStr = Value == 0 ? plusStr : Value < 0 ? "[ff6699]+" : "[42fe79]+"; AttrsLabel[6].text = EB.StringUtil.Format("{0}{1}%", colorStr, Mathf.FloorToInt((float)Temp));//6命中 if (Value != 0) { AttrsLabel[6].GetComponent <TweenScale>().ResetToBeginning(); AttrsLabel[6].GetComponent <TweenScale>().PlayForward(); } OldE_AttrValue[6] = Temp; plusStr = (E_Attr.SpRes + E_Attr.SuitAttr.SpRes) == 0 ? "[ffffff00]+[-]" : "+"; Temp = ((/*attrData.m_SpRes +*/ E_Attr.SpRes + E_Attr.SuitAttr.SpRes) * 100); Value = Temp - OldE_AttrValue[7]; colorStr = Value == 0 ? plusStr : Value < 0 ? "[ff6699]+" : "[42fe79]+"; AttrsLabel[7].text = EB.StringUtil.Format("{0}{1}%", colorStr, Mathf.FloorToInt((float)Temp));//7抵抗 if (Value != 0) { AttrsLabel[7].GetComponent <TweenScale>().ResetToBeginning(); AttrsLabel[7].GetComponent <TweenScale>().PlayForward(); } OldE_AttrValue[7] = Temp; }