| | |
| | | using System.Linq;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | using LitJson;
|
| | | using System.Collections;
|
| | |
|
| | | namespace vnxbqy.UI
|
| | |
| | | [SerializeField] Text getMatProgressText;
|
| | | [SerializeField] ButtonEx gotoShenfj;
|
| | | [SerializeField] ItemCell devItemCell;
|
| | | [SerializeField] ItemCell devItemCell2;
|
| | |
|
| | | [SerializeField] int singleLineNum = 5;
|
| | | [SerializeField] int sumGridNum = 100;
|
| | |
| | | bool isOpen = true;
|
| | | int getMatCycle = 0;
|
| | | int devItemID;//分解装备获得的材料ID
|
| | | int devItemID2;//红装分解装备获得的材料ID
|
| | | string devourFormula; //分解公式
|
| | | string devourFormula2; //红装分解公式
|
| | | int preViewDevItemCnt; //分解获得的材料数量
|
| | | int preViewDevItemCnt2; //红装分解获得的材料数量
|
| | | protected override void BindController()
|
| | | {
|
| | | colorlistObj.SetActive(true);
|
| | |
| | | getMatCycle = int.Parse(config.Numerical1);
|
| | | devItemID = int.Parse(config.Numerical4);
|
| | | devourFormula = config.Numerical5;
|
| | |
|
| | | //{"5":[3017,"1+itemClass"]}
|
| | | var json = JsonMapper.ToObject(FuncConfigConfig.Get("EquipDecomposeAward2").Numerical1);
|
| | | devItemID2 = int.Parse(json["5"][0].ToString());
|
| | | devourFormula2 = json["5"][1].ToString();
|
| | | }
|
| | | isOpen = true;
|
| | | playerPack.selectDevourlist.Clear();
|
| | |
| | | equipAddExpPreview = 0;
|
| | | EquipDeComposeConfig deComposeConfig = EquipDeComposeConfig.Get(playerPack.decomposeLv);
|
| | | devItemCell.SetActive(false);
|
| | | devItemCell2.SetActive(false);
|
| | | if (playerPack.selectDevourlist.Count > 0)
|
| | | {
|
| | | equipAddExpPreview = GetPreviewExpByDevour();
|
| | |
| | | devItemCell.Init(new ItemCellModel(devItemID, false, (ulong)preViewDevItemCnt));
|
| | | devItemCell.button.AddListener(() => {
|
| | | ItemTipUtility.Show(devItemID);
|
| | | });
|
| | | }
|
| | |
|
| | | if (preViewDevItemCnt2 != 0)
|
| | | {
|
| | | devItemCell2.SetActive(true);
|
| | | devItemCell2.Init(new ItemCellModel(devItemID2, false, (ulong)preViewDevItemCnt2));
|
| | | devItemCell2.button.AddListener(() => {
|
| | | ItemTipUtility.Show(devItemID2);
|
| | | });
|
| | | }
|
| | | }
|
| | |
| | | int GetPreviewExpByDevour()
|
| | | {
|
| | | int sumExp = 0;
|
| | | preViewDevItemCnt = 0; |
| | | preViewDevItemCnt = 0;
|
| | | preViewDevItemCnt2 = 0;
|
| | | for (int i = 0; i < playerPack.selectDevourlist.Count; i++)
|
| | | {
|
| | | int curExp = 0;
|
| | |
| | | curExp = tagPet.Exp;
|
| | | }
|
| | | preViewDevItemCnt += GetDogzScoreById(itemModel);
|
| | | preViewDevItemCnt2 += GetRedEquipDevourItemCnt(itemModel);
|
| | | }
|
| | | sumExp += curExp;
|
| | | }
|
| | |
| | | Equation.Instance.AddKeyValue("itemClass", itemModel.config.LV);
|
| | | return Equation.Instance.Eval<int>(devourFormula);
|
| | | }
|
| | |
|
| | | //红装分解可获得的材料数量
|
| | | public int GetRedEquipDevourItemCnt(ItemModel itemModel)
|
| | | {
|
| | | if (itemModel == null)
|
| | | return 0;
|
| | | if (itemModel.config.ItemColor < 5)
|
| | | return 0;
|
| | | Equation.Instance.Clear();
|
| | | Equation.Instance.AddKeyValue("itemColor", itemModel.config.ItemColor);
|
| | | Equation.Instance.AddKeyValue("isSuite", itemModel.config.SuiteiD == 0 ? 0 : 1);
|
| | | Equation.Instance.AddKeyValue("itemClass", itemModel.config.LV);
|
| | | return Equation.Instance.Eval<int>(devourFormula2);
|
| | | }
|
| | | }
|
| | | }
|