|
@@ -164,19 +164,32 @@ namespace Fort23.Mono
|
|
if (isOpenPre)
|
|
if (isOpenPre)
|
|
{
|
|
{
|
|
|
|
|
|
- if (PlayerManager.Instance.heroController.CanPromote(heroInfo) == HeroUpResultType.Success)
|
|
|
|
|
|
+ HeroUpResultType upResultType = PlayerManager.Instance.heroController.PromoteHeroLogic(heroInfo);
|
|
|
|
+
|
|
|
|
+ if (upResultType == HeroUpResultType.Success)
|
|
{
|
|
{
|
|
- heroInfo.Promote();
|
|
|
|
- PlayerManager.Instance.SaveHeroData(heroInfo);
|
|
|
|
UpdateAttributeUI();
|
|
UpdateAttributeUI();
|
|
HeroUITools.SetStarShow(stars, heroInfo.star.Value);
|
|
HeroUITools.SetStarShow(stars, heroInfo.star.Value);
|
|
- PlayerManager.Instance.heroController.SendEvent(HeroUpType.Promote, heroInfo, HeroUpResultType.Success);
|
|
|
|
ExitPowerUpPre(curPreTyp, upPre.Stars2);
|
|
ExitPowerUpPre(curPreTyp, upPre.Stars2);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
TipMessagePanel.OpenTipMessagePanel("资源不足", Vector2.zero);
|
|
TipMessagePanel.OpenTipMessagePanel("资源不足", Vector2.zero);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // if (PlayerManager.Instance.heroController.CanPromote(heroInfo) == HeroUpResultType.Success)
|
|
|
|
+ // {
|
|
|
|
+ // heroInfo.Promote();
|
|
|
|
+ // PlayerManager.Instance.SaveHeroData(heroInfo);
|
|
|
|
+ // UpdateAttributeUI();
|
|
|
|
+ // HeroUITools.SetStarShow(stars, heroInfo.star.Value);
|
|
|
|
+ // PlayerManager.Instance.heroController.SendEvent(HeroUpType.Promote, heroInfo, HeroUpResultType.Success);
|
|
|
|
+ // ExitPowerUpPre(curPreTyp, upPre.Stars2);
|
|
|
|
+ // }
|
|
|
|
+ // else
|
|
|
|
+ // {
|
|
|
|
+ // TipMessagePanel.OpenTipMessagePanel("资源不足", Vector2.zero);
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -490,55 +503,12 @@ namespace Fort23.Mono
|
|
|
|
|
|
PlayEft(isInit, txtHP, heroInfo.hp.Value.ToStringEx(), 0);
|
|
PlayEft(isInit, txtHP, heroInfo.hp.Value.ToStringEx(), 0);
|
|
|
|
|
|
- // if (txtHP.text != heroInfo.hp.Value.ToStringEx())
|
|
|
|
- // {
|
|
|
|
- // long old = long.Parse(txtHP.text);
|
|
|
|
- // txtHP.text = heroInfo.hp.Value.ToStringEx();
|
|
|
|
- // if(!isInit)
|
|
|
|
- // await UIManager.Instance.CreateGComponent<HeroUpTxtEft>(delegate(HeroUpTxtEft heroUpTxtEft)
|
|
|
|
- // {
|
|
|
|
- // heroUpTxtEft.txtEft.text = "+" + (heroInfo.hp.Value - old).ToStringEx();
|
|
|
|
- // },
|
|
|
|
- // poolName: "HeroUpTxtEft", root: eftNumPos[0] as RectTransform);
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
PlayEft(isInit, txtATK, heroInfo.attack.Value.ToStringEx(), 1);
|
|
PlayEft(isInit, txtATK, heroInfo.attack.Value.ToStringEx(), 1);
|
|
-
|
|
|
|
- // if (txtATK.text != heroInfo.attack.Value.ToStringEx())
|
|
|
|
- // {
|
|
|
|
- // long old = long.Parse(txtATK.text);
|
|
|
|
- // txtATK.text = heroInfo.attack.Value.ToStringEx();
|
|
|
|
- // if(!isInit)
|
|
|
|
- // await UIManager.Instance.CreateGComponent<HeroUpTxtEft>(delegate(HeroUpTxtEft heroUpTxtEft)
|
|
|
|
- // {
|
|
|
|
- // heroUpTxtEft.txtEft.text = "+" + (heroInfo.attack.Value - old).ToStringEx();
|
|
|
|
- // },
|
|
|
|
- // poolName: "HeroUpTxtEft", root: eftNumPos[1] as RectTransform);
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
|
|
+
|
|
PlayEft(isInit, txtDEF, heroInfo.defense.Value.ToStringEx(), 2);
|
|
PlayEft(isInit, txtDEF, heroInfo.defense.Value.ToStringEx(), 2);
|
|
- // if (txtDEF.text != heroInfo.defense.Value.ToStringEx())
|
|
|
|
- // {
|
|
|
|
- // long old = long.Parse(txtDEF.text);
|
|
|
|
- // txtDEF.text = heroInfo.defense.Value.ToStringEx();
|
|
|
|
- // if(!isInit)
|
|
|
|
- // await UIManager.Instance.CreateGComponent<HeroUpTxtEft>(delegate(HeroUpTxtEft heroUpTxtEft)
|
|
|
|
- // {
|
|
|
|
- // heroUpTxtEft.txtEft.text = "+" + (heroInfo.defense.Value - old).ToStringEx();
|
|
|
|
- // },
|
|
|
|
- // poolName: "HeroUpTxtEft", root: eftNumPos[2] as RectTransform);
|
|
|
|
- // }
|
|
|
|
|
|
|
|
PlayEft(isInit, txtSHANBI, heroInfo.shanbi.Value.ToStringEx(), 3);
|
|
PlayEft(isInit, txtSHANBI, heroInfo.shanbi.Value.ToStringEx(), 3);
|
|
- // if (txtSHANBI.text != heroInfo.shanbi.Value.ToStringEx())
|
|
|
|
- // {
|
|
|
|
- // txtSHANBI.text = heroInfo.shanbi.Value.ToStringEx();
|
|
|
|
- // if(!isInit)
|
|
|
|
- // await UIManager.Instance.CreateGComponent<HeroUpTxtEft>(null,
|
|
|
|
- // poolName: "HeroUpTxtEft", root: eftNumPos[3] as RectTransform);
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
txtLv.text = heroInfo.level.Value.ToStringEx();
|
|
txtLv.text = heroInfo.level.Value.ToStringEx();
|
|
txtExpGain.text = heroInfo.expGain.Value.ToStringEx();
|
|
txtExpGain.text = heroInfo.expGain.Value.ToStringEx();
|
|
|
|
|