Пример #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
    public static Color ColorConvert(string value, char split = ',')
    {
        if (string.IsNullOrEmpty(value))
        {
            return(Color.white);
        }
        string[] valueAry = value.Split(split);
        if (valueAry.Length != 4)
        {
            return(Color.white);
        }

        float red   = GameConvert.FloatConvert(valueAry[0]);
        float green = GameConvert.FloatConvert(valueAry[1]);
        float blue  = GameConvert.FloatConvert(valueAry[2]);
        float alphe = GameConvert.FloatConvert(valueAry[3]);

        return(new Color(red, green, blue, alphe));
    }
Пример #3
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();
    }
Пример #4
0
 public virtual void LoadData(XmlElement element)
 {
     m_start_time = GameConvert.FloatConvert(element.GetAttribute("StartTime"));
     m_end_time   = GameConvert.FloatConvert(element.GetAttribute("EndTime"));
 }