|
@@ -507,7 +507,12 @@ namespace Fort23.Mono
|
|
|
animateNumberList.Add(animTxtAtk);
|
|
|
animateNumberList.Add(animTxtDef);
|
|
|
animateNumberList.Add(animTxtShanBi);
|
|
|
-
|
|
|
+
|
|
|
+ curHp = 0;
|
|
|
+ curAtk = 0;
|
|
|
+ curDef = 0;
|
|
|
+ curShanBi = 0;
|
|
|
+
|
|
|
UpdateAttributeUI(true);
|
|
|
}
|
|
|
|
|
@@ -515,17 +520,19 @@ namespace Fort23.Mono
|
|
|
|
|
|
private long curHeroCount;
|
|
|
private long costHeroCount;
|
|
|
+
|
|
|
+ private long curHp, curAtk, curDef, curShanBi;
|
|
|
public async void UpdateAttributeUI(bool isInit = false)
|
|
|
{
|
|
|
StarsObj.SetActive(true);
|
|
|
|
|
|
- PlayEft(isInit, txtHP, heroInfo.hp.Value.ToStringEx(), 0);
|
|
|
+ PlayEft(isInit, txtHP, ref curHp, heroInfo.hp.Value, 0);
|
|
|
|
|
|
- PlayEft(isInit, txtATK, heroInfo.attack.Value.ToStringEx(), 1);
|
|
|
+ PlayEft(isInit, txtATK, ref curAtk, heroInfo.attack.Value, 1);
|
|
|
|
|
|
- PlayEft(isInit, txtDEF, heroInfo.defense.Value.ToStringEx(), 2);
|
|
|
+ PlayEft(isInit, txtDEF, ref curDef, heroInfo.defense.Value, 2);
|
|
|
|
|
|
- PlayEft(isInit, txtSHANBI, heroInfo.shanbi.Value.ToStringEx(), 3);
|
|
|
+ PlayEft(isInit, txtSHANBI, ref curShanBi, heroInfo.shanbi.Value, 3);
|
|
|
|
|
|
txtLv.text = heroInfo.level.Value.ToStringEx();
|
|
|
txtExpGain.text = heroInfo.expGain.Value.ToStringEx();
|
|
@@ -599,22 +606,24 @@ namespace Fort23.Mono
|
|
|
/// </summary>
|
|
|
/// <param name="isInit">是否为首次(初始), 首次不做动画处理</param>
|
|
|
/// <param name="txtOld">当前(旧的)</param>
|
|
|
- /// <param name="txtNew"></param>
|
|
|
+ /// <param name="newValue"></param>
|
|
|
/// <param name="eftRoot"></param>
|
|
|
- private async void PlayEft(bool isInit, TextMeshProUGUI txtOld, string txtNew, int idx)
|
|
|
+ private void PlayEft(bool isInit, TextMeshProUGUI txtOld, ref long curValue, long newValue, int idx)
|
|
|
{
|
|
|
- if (txtOld.text != txtNew)
|
|
|
+ if (curValue != newValue)
|
|
|
{
|
|
|
- long old = long.Parse(txtOld.text);
|
|
|
- long newV = long.Parse(txtNew);
|
|
|
- txtOld.text = txtNew;
|
|
|
+ // long old = long.Parse(txtOld.text);
|
|
|
+ // long newV = long.Parse(newValue);
|
|
|
+ long tmpValue = curValue;
|
|
|
+ curValue = newValue;
|
|
|
+ txtOld.text = newValue.ToStringEx();
|
|
|
if (!isInit)
|
|
|
{
|
|
|
- animateNumberList[idx].Start(old, newV);
|
|
|
+ animateNumberList[idx].Start(tmpValue, newValue);
|
|
|
|
|
|
- await UIManager.Instance.CreateGComponent(delegate(HeroUpTxtEft heroUpTxtEft)
|
|
|
+ UIManager.Instance.CreateGComponent(delegate(HeroUpTxtEft heroUpTxtEft)
|
|
|
{
|
|
|
- heroUpTxtEft.txtEft.text = "+" + (newV - old).ToStringEx();
|
|
|
+ heroUpTxtEft.txtEft.text = "+" + (newValue - tmpValue).ToStringEx();
|
|
|
},
|
|
|
poolName: "HeroUpTxtEft", root: eftNumPos[idx] as RectTransform);
|
|
|
}
|