Пример #1
0
    /// <summary>
    /// 设置属性信息
    /// </summary>
    private void SetPropInfo()
    {
        float fight = 0;
        List <EquipAddInfo> prop_list = EquipConfig.GetPropAddDataListByID(-1, int.Parse(select_equip.itemID), select_equip.star, select_equip.strongLevel);

        for (int i = 0; i < prop_list.Count; i++)
        {
            EquipAddInfo info = prop_list[i];

            PropFightInfo prop_fight = PropChangeFightConfig.GetEquipInfo(info.prop_name);

            string  prop_name_label = string.Format("prop_name_{0}", i.ToString());
            UILabel prop_name       = UtilTools.GetChild <UILabel>(panel.equipProp, prop_name_label);
            prop_name.text = TextManager.GetUIString(info.prop_name);

            string  prop_txt_label = string.Format("prop_value_{0}", i.ToString());
            UILabel cur_prop_txt   = UtilTools.GetChild <UILabel>(panel.equipProp, prop_txt_label);
            float   prop_value     = GameConvert.FloatConvert((info.prop_base_value + info.prop_star_value + info.prop_strong_value));

            //cur_prop_txt.text = prop_fight.IsPercent==0?prop_value.ToString():string.Format("{0}%", prop_value*100);
            cur_prop_txt.text = prop_value.ToString();
            fight            += PropChangeFightConfig.GetPropForFightValue(info.prop_name, prop_value);
        }

        UILabel fight_txt = UtilTools.GetChild <UILabel>(panel.equipProp, "fight_value");

        fight_txt.text = GameConvert.IntConvert(fight).ToString();
    }
Пример #2
0
    /// <summary>
    /// 设置属性信息
    /// </summary>
    private void SetPropInfo()
    {
        float fight = 0;
        List <EquipAddInfo> prop_list = GetPropAddList();

        for (int i = 0; i < prop_list.Count; i++)
        {
            EquipAddInfo info = prop_list[i];

            string  prop_name_label = string.Format("prop_name_{0}", i.ToString());
            UILabel prop_name       = UtilTools.GetChild <UILabel>(panel.cur_equip, prop_name_label);
            prop_name.text = TextManager.GetUIString(info.prop_name);

            string  prop_txt_label = string.Format("prop_value_{0}", i.ToString());
            UILabel cur_prop_txt   = UtilTools.GetChild <UILabel>(panel.cur_equip, prop_txt_label);
            cur_prop_txt.text = (info.prop_base_value).ToString();

            fight += PropChangeFightConfig.GetPropForFightValue(info.prop_name, GameConvert.FloatConvert(info.prop_base_value));
        }

        UILabel fight_txt = UtilTools.GetChild <UILabel>(panel.cur_equip, "fight_value");

        fight_txt.text = GameConvert.IntConvert(fight).ToString();
    }