|
@@ -59,7 +59,7 @@ namespace Fort23.Mono
|
|
|
upPre = await UIManager.Instance.CreateGComponentForObject<HeroPowerUpPre>(objHeroPowerUpPre,
|
|
|
delegate(HeroPowerUpPre pre)
|
|
|
{
|
|
|
- EnterUpgradePre(2);
|
|
|
+ EnterPowerUpPre(2);
|
|
|
pre.OpenPromotePre(heroInfo);
|
|
|
}, root: rtBottom);
|
|
|
|
|
@@ -75,16 +75,6 @@ namespace Fort23.Mono
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void EnterPromotePre()
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- private void ExitPromotePre()
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// 是否打开了升级/升星的预览界面
|
|
|
/// </summary>
|
|
@@ -102,7 +92,7 @@ namespace Fort23.Mono
|
|
|
else if (resultType == HeroUpResultType.PlayUpgradeEftFirst)
|
|
|
{
|
|
|
//TODO 要播放特效.
|
|
|
- ExitUpgradePre(1);
|
|
|
+ ExitPowerUpPre(1);
|
|
|
UpdateAttributeUI();
|
|
|
}
|
|
|
else if(resultType == HeroUpResultType.NeedOpenPreUI)
|
|
@@ -110,7 +100,7 @@ namespace Fort23.Mono
|
|
|
upPre = await UIManager.Instance.CreateGComponentForObject<HeroPowerUpPre>(objHeroPowerUpPre,
|
|
|
delegate(HeroPowerUpPre pre)
|
|
|
{
|
|
|
- EnterUpgradePre(1);
|
|
|
+ EnterPowerUpPre(1);
|
|
|
pre.OpenUpgradePre(heroInfo);
|
|
|
}, root: rtBottom);
|
|
|
}
|
|
@@ -133,7 +123,7 @@ namespace Fort23.Mono
|
|
|
/// 进入 升级/升星预览界面
|
|
|
/// </summary>
|
|
|
/// <param name="preTyp">1升级;2 升星</param>
|
|
|
- private void EnterUpgradePre(byte preTyp)
|
|
|
+ private void EnterPowerUpPre(byte preTyp)
|
|
|
{
|
|
|
isOpenPre = true;
|
|
|
curPreTyp = preTyp;
|
|
@@ -151,6 +141,17 @@ namespace Fort23.Mono
|
|
|
RectTransform rt = btnPromote.GetComponent<RectTransform>();
|
|
|
rt.sizeDelta = new Vector2(510, rt.sizeDelta.y);
|
|
|
rt.localPosition = new Vector3(47, rt.localPosition.y, rt.localPosition.z);
|
|
|
+
|
|
|
+ if (costHeroCount > curHeroCount)
|
|
|
+ {
|
|
|
+ btnPromote.GetComponent<MyImage>().icon_name = "btn_l_Gray";
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ btnPromote.GetComponent<MyImage>().icon_name = "btn_l_Green";
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -159,7 +160,7 @@ namespace Fort23.Mono
|
|
|
/// 离开 升级/升星预览界面
|
|
|
/// </summary>
|
|
|
/// <param name="preTyp">1升级;2 升星</param>
|
|
|
- private void ExitUpgradePre(byte preTyp)
|
|
|
+ private void ExitPowerUpPre(byte preTyp)
|
|
|
{
|
|
|
isOpenPre = false;
|
|
|
btns1.SetActive(true);
|
|
@@ -177,11 +178,10 @@ namespace Fort23.Mono
|
|
|
RectTransform rt = btnPromote.GetComponent<RectTransform>();
|
|
|
rt.sizeDelta = new Vector2(180, rt.sizeDelta.y);
|
|
|
rt.localPosition = new Vector3(-135f, rt.localPosition.y, rt.localPosition.z);
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
+ btnPromote.GetComponent<MyImage>().icon_name = "btn_l_Green";
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
objHeroPowerUpPre.SetActive(false);
|
|
|
}
|
|
|
|
|
@@ -212,7 +212,7 @@ namespace Fort23.Mono
|
|
|
{
|
|
|
if (isOpenPre)
|
|
|
{
|
|
|
- ExitUpgradePre(curPreTyp);
|
|
|
+ ExitPowerUpPre(curPreTyp);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -287,6 +287,8 @@ namespace Fort23.Mono
|
|
|
UpdateAttributeUI(true);
|
|
|
}
|
|
|
|
|
|
+ private long curHeroCount;
|
|
|
+ private long costHeroCount;
|
|
|
public async void UpdateAttributeUI(bool isInit = false)
|
|
|
{
|
|
|
if (txtHP.text != heroInfo.hp.Value.ToStringEx())
|
|
@@ -335,18 +337,21 @@ namespace Fort23.Mono
|
|
|
{
|
|
|
redColorStar = "<color=#FF4C4C>";
|
|
|
redColorEnd = "</color>";
|
|
|
+
|
|
|
+ btnUpgrade.GetComponent<MyImage>().icon_name = "btn_l_Gray";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
redColorStar = "";
|
|
|
redColorEnd = "";
|
|
|
+ btnUpgrade.GetComponent<MyImage>().icon_name = "btn_l_Green";
|
|
|
}
|
|
|
|
|
|
txtUpgrade.text = redColorStar + curExp + redColorEnd + "/" + costExp;
|
|
|
|
|
|
|
|
|
- long curHeroCount = BagController.Instance.GetItemInfo(heroInfo.modelConfig.itemID).count.Value;
|
|
|
- long costHeroCount = heroInfo.promoteConfig.costCount;
|
|
|
+ curHeroCount = BagController.Instance.GetItemInfo(heroInfo.modelConfig.itemID).count.Value;
|
|
|
+ costHeroCount = heroInfo.promoteConfig.costCount;
|
|
|
|
|
|
if (costHeroCount > curHeroCount)
|
|
|
{
|
|
@@ -361,8 +366,8 @@ namespace Fort23.Mono
|
|
|
|
|
|
txtPromote.text = redColorStar + curHeroCount + redColorEnd + "/" + costHeroCount;
|
|
|
|
|
|
- LogTool.Log(PlayerManager.Instance.heroController.CanUpgrade(heroInfo));
|
|
|
- LogTool.Log(go1.activeSelf);
|
|
|
+ // LogTool.Log(PlayerManager.Instance.heroController.CanUpgrade(heroInfo));
|
|
|
+ // LogTool.Log(go1.activeSelf);
|
|
|
if (PlayerManager.Instance.heroController.CanUpgrade(heroInfo) == HeroUpResultType.MainLevelNotEnough)
|
|
|
{
|
|
|
go1.SetActive(false);
|
|
@@ -374,7 +379,7 @@ namespace Fort23.Mono
|
|
|
{
|
|
|
go1.SetActive(true);
|
|
|
txtUpLimit.gameObject.SetActive(false);
|
|
|
- btnUpgrade.GetComponent<MyImage>().icon_name = "btn_l_Green";
|
|
|
+ // btnUpgrade.GetComponent<MyImage>().icon_name = "btn_l_Green";
|
|
|
}
|
|
|
}
|
|
|
|