유닛 최대레벨 도달시 에러 반환 버그 수정
This commit is contained in:
parent
516c777c23
commit
167fcfa910
|
|
@ -991,7 +991,9 @@ MonoBehaviour:
|
||||||
newBuildingUI: {fileID: 1842952264}
|
newBuildingUI: {fileID: 1842952264}
|
||||||
buildingLevelupUI: {fileID: 1785205477}
|
buildingLevelupUI: {fileID: 1785205477}
|
||||||
backButton: {fileID: 1396764732}
|
backButton: {fileID: 1396764732}
|
||||||
|
buyButton: {fileID: 401326400}
|
||||||
buyText: {fileID: 663203141}
|
buyText: {fileID: 663203141}
|
||||||
|
sellButton: {fileID: 914591067}
|
||||||
sellText: {fileID: 1782769547}
|
sellText: {fileID: 1782769547}
|
||||||
moneyText: {fileID: 13568456}
|
moneyText: {fileID: 13568456}
|
||||||
unitSpriteButton:
|
unitSpriteButton:
|
||||||
|
|
|
||||||
|
|
@ -43,11 +43,17 @@ public class BuildingCtrl : MonoBehaviour
|
||||||
sell += unitInfo.unit.buy[n];
|
sell += unitInfo.unit.buy[n];
|
||||||
}
|
}
|
||||||
sell /= 3;
|
sell /= 3;
|
||||||
|
if(buildingLevel != 5)
|
||||||
PlayCtrl.Instance.LevelupBuyAndSellText(unitInfo.unit.buy[buildingLevel], sell);
|
PlayCtrl.Instance.LevelupBuyAndSellText(unitInfo.unit.buy[buildingLevel], sell);
|
||||||
|
else
|
||||||
|
PlayCtrl.Instance.LevelupBuyAndSellText(-1, sell);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PlayCtrl.Instance.LevelupBuyAndSellText(500 * buildingLevel, 0);
|
if (buildingLevel != 5)
|
||||||
|
PlayCtrl.Instance.LevelupBuyAndSellText(150 * buildingLevel, -1);
|
||||||
|
else
|
||||||
|
PlayCtrl.Instance.LevelupBuyAndSellText(-1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -85,12 +91,12 @@ public class BuildingCtrl : MonoBehaviour
|
||||||
PlayCtrl.Instance.player.buildings[wave].level[position - 1] = buildingLevel + 1;
|
PlayCtrl.Instance.player.buildings[wave].level[position - 1] = buildingLevel + 1;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
if(500 * buildingLevel > PlayCtrl.Instance.money)
|
if(150 * buildingLevel > PlayCtrl.Instance.money)
|
||||||
{
|
{
|
||||||
Debug.Log("±¸¸Åºñ¿ëÀÌ ºÎÁ·ÇÕ´Ï´Ù");
|
Debug.Log("±¸¸Åºñ¿ëÀÌ ºÎÁ·ÇÕ´Ï´Ù");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PlayCtrl.Instance.TextUpdate(-500 * buildingLevel);
|
PlayCtrl.Instance.TextUpdate(-150 * buildingLevel);
|
||||||
PlayCtrl.Instance.player.addMoney[wave] += 100;
|
PlayCtrl.Instance.player.addMoney[wave] += 100;
|
||||||
}
|
}
|
||||||
buildingLevel++;
|
buildingLevel++;
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,9 @@ public class PlayCtrl : SingletonMonoBehaviour<PlayCtrl>
|
||||||
public GameObject buildingLevelupUI;
|
public GameObject buildingLevelupUI;
|
||||||
public GameObject backButton;
|
public GameObject backButton;
|
||||||
UnitCtrl[] units;
|
UnitCtrl[] units;
|
||||||
|
[SerializeField] Button buyButton;
|
||||||
public TMP_Text buyText;
|
public TMP_Text buyText;
|
||||||
|
[SerializeField] Button sellButton;
|
||||||
public TMP_Text sellText;
|
public TMP_Text sellText;
|
||||||
public TMP_Text moneyText;
|
public TMP_Text moneyText;
|
||||||
public Image[] unitSpriteButton;
|
public Image[] unitSpriteButton;
|
||||||
|
|
@ -143,10 +145,31 @@ public class PlayCtrl : SingletonMonoBehaviour<PlayCtrl>
|
||||||
|
|
||||||
public void LevelupBuyAndSellText(int buy, int sell)
|
public void LevelupBuyAndSellText(int buy, int sell)
|
||||||
{
|
{
|
||||||
|
if (buy == -1)
|
||||||
|
{
|
||||||
|
buyButton.interactable = false;
|
||||||
|
buyText.text = $"강화(0)";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
buyButton.interactable = true;
|
||||||
buyText.text = $"강화({buy})";
|
buyText.text = $"강화({buy})";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sell == -1)
|
||||||
|
{
|
||||||
|
sellButton.interactable = false;
|
||||||
|
sellText.text = $"건물 제거(0)";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sellButton.interactable = true;
|
||||||
sellText.text = $"건물 제거({sell})";
|
sellText.text = $"건물 제거({sell})";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void TextUpdate(int addMoney)
|
public void TextUpdate(int addMoney)
|
||||||
{
|
{
|
||||||
if (money != int.Parse(moneyText.text))
|
if (money != int.Parse(moneyText.text))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue