コード例 #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
ファイル: equipstarpanel.cs プロジェクト: liuyongsz/bmobdemo
    /// <summary>
    /// 设置属性信息
    /// </summary>
    private void SetPropInfo()
    {
        UISprite[] cur_star  = UtilTools.GetChilds <UISprite>(panel.prop_info, "star");
        UISprite[] next_star = UtilTools.GetChilds <UISprite>(panel.prop_info, "next_star");

        UtilTools.SetStar(cur_star_num, cur_star);
        UtilTools.SetStar(next_star_num, next_star);

        List <EquipAddInfo> prop_list = EquipConfig.GetPropAddDataListByID(0, cur_equip_info.id, cur_star_num, cur_strong_lv);

        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.prop_info, prop_name_label);
            prop_name.text = TextManager.GetUIString(info.prop_name);

            string  cur_prop_txt_label = string.Format("cur_prop_value_{0}", i.ToString());
            UILabel cur_prop_txt       = UtilTools.GetChild <UILabel>(panel.prop_info, cur_prop_txt_label);
            cur_prop_txt.text = (info.prop_base_value + info.prop_strong_value + info.prop_star_value).ToString();

            string  next_prop_txt_label = string.Format("next_prop_value_{0}", i.ToString());
            UILabel next_prop_txt       = UtilTools.GetChild <UILabel>(panel.prop_info, next_prop_txt_label);
            next_prop_txt.text = (info.prop_base_value + info.prop_next_strong_value + info.prop_next_star_value).ToString();
        }
    }
コード例 #3
0
    /// <summary>
    /// 设置属性信息
    /// </summary>
    public void SetPropInfo()
    {
        strong_info = EquipStrongConfig.GetEquipStrongInfo(cur_equip_info.star, cur_strong_lv);
        if (strong_info == null)
        {
            return;
        }

        panel.goldtext.text = strong_info.cost.ToString();

        List <EquipAddInfo> prop_list = EquipConfig.GetPropAddDataListByID(1, cur_equip_info.id, cur_star, cur_strong_lv);

        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.prop_info, prop_name_label);
            prop_name.text = TextManager.GetUIString(info.prop_name);

            string  cur_prop_txt_label = string.Format("cur_prop_value_{0}", i.ToString());
            UILabel cur_prop_txt       = UtilTools.GetChild <UILabel>(panel.prop_info, cur_prop_txt_label);
            cur_prop_txt.text = (info.prop_base_value + info.prop_strong_value + info.prop_star_value).ToString();

            string  next_prop_txt_label = string.Format("next_prop_value_{0}", i.ToString());
            UILabel next_prop_txt       = UtilTools.GetChild <UILabel>(panel.prop_info, next_prop_txt_label);
            next_prop_txt.text = (info.prop_base_value + info.prop_next_strong_value + info.prop_next_star_value).ToString();
        }
    }
コード例 #4
0
ファイル: equipmakepanel.cs プロジェクト: liuyongsz/bmobdemo
    /// <summary>
    /// 获取属性增加数据
    /// </summary>
    /// <returns></returns>

    private List <EquipAddInfo> GetPropAddList()
    {
        EquipAddInfo info = null;

        string[]            prop_arr = Define.EquipPropStr.Split(',');
        List <EquipAddInfo> list     = new List <EquipAddInfo>();

        for (int i = 0; i < prop_arr.Length; i++)
        {
            string prop_str   = prop_arr[i];
            int    prop_value = GameConvert.IntConvert(cur_equip_info.GetType().GetField(prop_str).GetValue(cur_equip_info));

            if (prop_value == 0)
            {
                continue;
            }

            info = new EquipAddInfo();

            info.prop_name       = prop_str;
            info.prop_base_value = prop_value;

            list.Add(info);
        }
        return(list);
    }
コード例 #5
0
    private void ResultGrid_UpdateItem(UIGridItem item)
    {
        if (item == null || item.mScripts == null || item.oData == null)
        {
            return;
        }

        StrongResultData strong_info = item.oData as StrongResultData;

        UILabel   cur_lv     = item.mScripts[0] as UILabel;
        UILabel   next_lv    = item.mScripts[1] as UILabel;
        UILabel   crit_txt   = item.mScripts[2] as UILabel;
        EquipInfo equip_info = EquipConfig.GetEquipInfo(int.Parse(EquipMediator.cur_equip.itemID));

        crit_txt.gameObject.SetActive(strong_info.nextStrong - strong_info.preStrong > 1);
        cur_lv.text  = strong_info.preStrong.ToString();
        next_lv.text = strong_info.nextStrong.ToString();

        EquipAddInfo        info      = null;
        List <EquipAddInfo> prop_list = EquipConfig.GetPropAddDataListByID(-1, equip_info.id, EquipMediator.cur_equip.star, strong_info.preStrong);

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

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

            string  cur_prop_txt_label = string.Format("cur_prop_value_{0}", i.ToString());
            UILabel cur_prop_txt       = UtilTools.GetChild <UILabel>(item.transform, cur_prop_txt_label);
            cur_prop_txt.text = (info.prop_base_value + info.prop_strong_value + info.prop_star_value).ToString();
        }

        List <EquipAddInfo> next_prop_list = EquipConfig.GetPropAddDataListByID(-1, equip_info.id, EquipMediator.cur_equip.star, strong_info.nextStrong);

        for (int j = 0; j < next_prop_list.Count; j++)
        {
            info = next_prop_list[j];

            string  next_prop_txt_label = string.Format("next_prop_value_{0}", j.ToString());
            UILabel next_prop_txt       = UtilTools.GetChild <UILabel>(item.transform, next_prop_txt_label);
            next_prop_txt.text = (info.prop_base_value + info.prop_strong_value + info.prop_star_value).ToString();
        }
    }
コード例 #6
0
    private void SetInherit()
    {
        panel.goldtext.text = GetNeedEuro() + "";

        UISprite[] star_obj = UtilTools.GetChilds <UISprite>(panel.select_equip, "star");
        UtilTools.SetStar(select_equip_data.star, star_obj);

        UISprite color = UtilTools.GetChild <UISprite>(panel.select_equip, "color");

        color.spriteName = "color" + select_equip_data.star;

        UITexture icon = UtilTools.GetChild <UITexture>(panel.select_equip, "icon");

        LoadSprite.LoaderItem(icon, select_equip_data.itemID, false);


        next_strong_lv = select_equip_data.strongLevel - 10;
        strong_info    = EquipStrongConfig.GetEquipStrongInfo(cur_equip_info.star, next_strong_lv);
        if (strong_info == null)
        {
            return;
        }



        UILabel next_strong_txt = UtilTools.GetChild <UILabel>(panel.prop_info, "next_strong_lv");

        next_strong_txt.text = "Lv." + next_strong_lv.ToString();

        List <EquipAddInfo> prop_list = EquipConfig.GetPropAddDataListByID(-1, int.Parse(select_equip_data.itemID), cur_star, next_strong_lv);

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

            string  next_prop_txt_label = string.Format("next_prop_value_{0}", i.ToString());
            UILabel next_prop_txt       = UtilTools.GetChild <UILabel>(panel.prop_info, next_prop_txt_label);
            next_prop_txt.text = (info.prop_base_value + info.prop_next_strong_value + info.prop_next_star_value).ToString();
        }
    }
コード例 #7
0
ファイル: equipmakepanel.cs プロジェクト: liuyongsz/bmobdemo
    /// <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();
    }
コード例 #8
0
ファイル: EquipConfig.cs プロジェクト: liuyongsz/bmobdemo
    /// <summary>
    /// 获取属性增加数据
    /// type ==0 升星 ,==1 升级, ==-1 装备当前属性值
    /// </summary>
    /// <returns></returns>

    public static List <EquipAddInfo> GetPropAddDataListByID(int type, int equip_id, int star, int strong)
    {
        EquipAddInfo info = null;

        string[] prop_arr = Define.EquipPropStr.Split(',');

        EquipInfo equip_info     = GetEquipInfo(equip_id);
        int       next_star_num  = star;
        int       next_strong_lv = strong;

        if (type == 0)
        {
            next_star_num = star == equip_info.maxStar ? equip_info.maxStar : star + 1;
        }

        if (type == 1)
        {
            next_strong_lv = strong >= equip_info.maxStrongLevel ? equip_info.maxStrongLevel : strong + 1;
        }

        List <EquipAddInfo> list = new List <EquipAddInfo>();

        for (int i = 0; i < prop_arr.Length; i++)
        {
            info = new EquipAddInfo();

            string prop_str   = prop_arr[i];
            int    prop_value = equip_info == null ? 0 : GameConvert.IntConvert(equip_info.GetType().GetField(prop_str).GetValue(equip_info));
            if (prop_value == 0)
            {
                continue;
            }

            // 获取星级属性
            EquipStar star_info       = EquipStarConfig.GetEquipStarInfo(equip_id, star);
            int       prop_star_value = star_info == null ? 0 : GameConvert.IntConvert(star_info.GetType().GetField(prop_str).GetValue(star_info));

            EquipStar star_next_info       = EquipStarConfig.GetEquipStarInfo(equip_id, next_star_num);
            int       prop_next_star_value = star_next_info == null ? 0 : GameConvert.IntConvert(star_next_info.GetType().GetField(prop_str).GetValue(star_next_info));

            //获取强化
            int         prop_strong_value    = 0;
            int         next_prop_star_value = 0;
            EquipStrong strong_info          = EquipStrongConfig.GetEquipStrongInfo(equip_info.star, strong);
            EquipStrong next_strong_info     = EquipStrongConfig.GetEquipStrongInfo(equip_info.star, next_strong_lv);

            if (strong_info != null)
            {
                prop_strong_value = GameConvert.IntConvert(strong_info.GetType().GetField(prop_str).GetValue(strong_info));
            }

            if (next_strong_info != null)
            {
                next_prop_star_value = GameConvert.IntConvert(next_strong_info.GetType().GetField(prop_str).GetValue(next_strong_info));
            }


            info.prop_name              = prop_str;
            info.prop_base_value        = prop_value;
            info.prop_star_value        = prop_star_value;
            info.prop_next_star_value   = prop_next_star_value;
            info.prop_strong_value      = prop_strong_value;
            info.prop_next_strong_value = next_prop_star_value;

            list.Add(info);
        }
        return(list);
    }