コード例 #1
0
        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;
        }