示例#1
0
        public static string GetEquipPropertyDes(SysEquipVo equipVo)
        {
            StringBuilder sb = new StringBuilder();

            if (equipVo.hp.Length > 4)
            {
                sb.Append("生命+").Append(PetLogic.GetEquipProperty(equipVo.hp));
            }
            if (equipVo.att_max > 0)
            {
                sb.Append("\n").Append("攻击+").Append(equipVo.att_max);
            }
            if (equipVo.def_p.Length > 4)
            {
                sb.Append("\n").Append("物防+").Append(PetLogic.GetEquipProperty(equipVo.def_p));
            }
            if (equipVo.def_m.Length > 4)
            {
                sb.Append("\n").Append("魔防+").Append(PetLogic.GetEquipProperty(equipVo.def_m));
            }
            if (equipVo.hurt_re.Length > 4)
            {
                sb.Append("\n").Append("减伤+").Append(PetLogic.GetEquipProperty(equipVo.hurt_re));
            }
            return(sb.ToString());
        }
示例#2
0
        private void SetEquipProperty(SysEquipVo equipVo)
        {
            int num = 0;
            if (equipVo.hp.Length>4)
            {
                num++;
                NGUITools.FindInChild<UILabel>(leftObj, "labels/property" + num).text = "生命:+" + PetLogic.GetEquipProperty(equipVo.hp);
            }

            if (equipVo.att_max>0)
            {
                num++;
                NGUITools.FindInChild<UILabel>(leftObj, "labels/property" + num).text = "攻击:+" + equipVo.att_max;
            }
            if (equipVo.def_p.Length > 4)
            {
                num++;
                NGUITools.FindInChild<UILabel>(leftObj, "labels/property" + num).text = "物防:+" + PetLogic.GetEquipProperty(equipVo.def_p);
            }
            if (equipVo.def_m.Length > 4)
            {
                num++;
                NGUITools.FindInChild<UILabel>(leftObj, "labels/property" + num).text = "魔防:+" + PetLogic.GetEquipProperty(equipVo.def_m);
            }
            if (equipVo.hurt_re.Length > 4)
            {
                num++;
                NGUITools.FindInChild<UILabel>(leftObj, "labels/property" + num).text = "减伤:+" + PetLogic.GetEquipProperty(equipVo.hurt_re);
            }

            for (int i=1; i< 6; i++)
            {
                if (i <= num)
                {
                    NGUITools.FindChild(leftObj, "labels/property" + i).SetActive(true);
                }
                else
                {
                    NGUITools.FindChild(leftObj, "labels/property" + i).SetActive(false);
                }
            }

        }