|
@@ -23,7 +23,8 @@ namespace GFGGame
|
|
|
private int _nowCountCanUpLevel = 0;
|
|
|
private long _goldsHasNum = 0;
|
|
|
private int _cumulativeGold = 0;
|
|
|
-
|
|
|
+ private int _cfgMaxLevel = 0;
|
|
|
+
|
|
|
public override void Dispose()
|
|
|
{
|
|
|
EffectUIPool.Recycle(_effectUI1);
|
|
@@ -59,6 +60,7 @@ namespace GFGGame
|
|
|
{
|
|
|
float volumn = (float)_ui.m_slideUpLevel.value / 100;
|
|
|
_nowCountCanUpLevel = _cardData.lv + (int)(volumn * (_countCanUpMaxLevel - _cardData.lv));
|
|
|
+ tidyData(_cfgMaxLevel, "Max");
|
|
|
tidyData(_nowCountCanUpLevel);
|
|
|
ReferViewInfo();
|
|
|
}
|
|
@@ -76,14 +78,13 @@ namespace GFGGame
|
|
|
ClearItemsCountList();
|
|
|
|
|
|
_ui.m_slideUpLevel.value = 0;
|
|
|
- int cfgMaxLevel = CardLvlCfgArray.Instance.GetCfgsByrarity(_cardData.itemCfg.rarity).Count - 1;
|
|
|
- tidyData(cfgMaxLevel);
|
|
|
- _countCanUpMaxLevel = _nowCountCanUpLevel;
|
|
|
+ _cfgMaxLevel = CardLvlCfgArray.Instance.GetCfgsByrarity(_cardData.itemCfg.rarity).Count;
|
|
|
+ tidyData(_cfgMaxLevel, "Max");
|
|
|
tidyData(_cardData.lv);
|
|
|
ReferViewInfo();
|
|
|
}
|
|
|
|
|
|
- private void tidyData(int setLevel)
|
|
|
+ private void tidyData(int setLevel,string tidyType = "")
|
|
|
{
|
|
|
_nowCountCanUpLevel = 0;
|
|
|
_goldsHasNum = 0;
|
|
@@ -118,14 +119,23 @@ namespace GFGGame
|
|
|
_cumulativeGold = _cumulativeGold + (sumNum * cardUpLvGolds[1]);
|
|
|
}
|
|
|
}
|
|
|
- _nowCountCanUpLevel = _cardData.lv;
|
|
|
+ if(tidyType == "Max")
|
|
|
+ _countCanUpMaxLevel = _cardData.lv;
|
|
|
+ else
|
|
|
+ _nowCountCanUpLevel = _cardData.lv;
|
|
|
allNeedLevelExp = _cardData.exp + CumulativeExp;
|
|
|
+ int lvLimit = RoleLevelCfgArray.Instance.GetCfg(RoleDataManager.lvl).cardLeverLimit;
|
|
|
for (int i = _cardData.lv; i < setLevel; i++)
|
|
|
{
|
|
|
int needLevelExp = CardLvlCfgArray.Instance.GetCfgByrarityAndcardLvl(_cardData.itemCfg.rarity, i).needExp;
|
|
|
allNeedLevelExp -= needLevelExp;
|
|
|
- if (allNeedLevelExp >= 0)
|
|
|
- _nowCountCanUpLevel += 1;
|
|
|
+ if (allNeedLevelExp >= 0 && _nowCountCanUpLevel <= lvLimit)
|
|
|
+ {
|
|
|
+ if (tidyType == "Max")
|
|
|
+ _countCanUpMaxLevel += 1;
|
|
|
+ else
|
|
|
+ _nowCountCanUpLevel += 1;
|
|
|
+ }
|
|
|
else
|
|
|
break;
|
|
|
}
|
|
@@ -192,6 +202,7 @@ namespace GFGGame
|
|
|
listItem.m_ImgpinkGot.visible = (_listItemChose[index] != 0);
|
|
|
UI_ComItem.ProxyEnd();
|
|
|
ClearItemsCountList();
|
|
|
+ tidyData(_cfgMaxLevel, "Max");
|
|
|
tidyData(_nowCountCanUpLevel);
|
|
|
ReferViewInfo();
|
|
|
ReferSlide();
|
|
@@ -226,6 +237,7 @@ namespace GFGGame
|
|
|
_nowCountCanUpLevel -= 1;
|
|
|
if (_nowCountCanUpLevel < _cardData.lv)
|
|
|
_nowCountCanUpLevel = _cardData.lv;
|
|
|
+ tidyData(_cfgMaxLevel, "Max");
|
|
|
tidyData(_nowCountCanUpLevel);
|
|
|
ReferViewInfo();
|
|
|
ReferSlide();
|