コード例 #1
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();
        }
    }
コード例 #2
0
ファイル: EquipProxy.cs プロジェクト: liuyongsz/bmobdemo
    /// <summary>
    /// 服务器返回装备一键强化结果
    /// </summary>
    /// <param name="list"></param>
    public void getOneKeyUpStrongResult(object obj, Dictionary <string, object> equip, List <object> list)
    {
        int card_id = GameConvert.IntConvert(obj);

        EquipItemInfo item = new EquipItemInfo();

        item.uuid        = equip["UUID"].ToString();
        item.itemID      = equip["itemID"].ToString();
        item.star        = GameConvert.IntConvert(equip["star"]);
        item.strongLevel = GameConvert.IntConvert(equip["strongLevel"]);
        item.gem1        = GameConvert.IntConvert(equip["gem1"]);
        item.gem2        = GameConvert.IntConvert(equip["gem2"]);
        item.gem3        = GameConvert.IntConvert(equip["gem3"]);

        EquipMediator.cur_equip = item;
        EquipConfig.RefreshEquipData(card_id, item);
        EquipMediator.equipMediator.RefreshOpenFunc(item.star, item.strongLevel);


        StrongResultData        info        = null;
        List <StrongResultData> list_strong = new List <StrongResultData>();

        for (int i = 0; i < list.Count; ++i)
        {
            Dictionary <string, object> data = list[i] as Dictionary <string, object>;
            info            = new StrongResultData();
            info.preStrong  = GameConvert.IntConvert(data["preStrong"]);
            info.nextStrong = GameConvert.IntConvert(data["nextStrong"]);
            info.cost       = GameConvert.IntConvert(data["cost"]);
            list_strong.Add(info);
        }
        EquipStrongResultMediator.info_list = list_strong;
        Facade.SendNotification(NotificationID.EquipStrongResult_Show);
        //GUIManager.SetPromptInfo(TextManager.GetUIString("UI2022"), null);
        EquipMediator.equipMediator.SetEquipGridInfo(card_id);
    }