From db0d9b651ad5797ac7a04f62ff1da83afc546511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=8C=90=EB=8F=8C?= Date: Sun, 5 Nov 2023 19:49:58 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8C=90=EB=A7=A4=20=EB=B0=98=ED=99=98=20?= =?UTF-8?q?=EC=8B=9C=EC=8A=A4=ED=85=9C=20=EC=9E=91=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Client/Assets/1_Script/Info/BuildingCtrl.cs | 7 +++++++ Client/Assets/1_Script/PlayCtrl.cs | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Client/Assets/1_Script/Info/BuildingCtrl.cs b/Client/Assets/1_Script/Info/BuildingCtrl.cs index 3a882431..68b08ab3 100644 --- a/Client/Assets/1_Script/Info/BuildingCtrl.cs +++ b/Client/Assets/1_Script/Info/BuildingCtrl.cs @@ -85,6 +85,13 @@ public class BuildingCtrl : MonoBehaviour Debug.Log("»ý»ê°Ç¹°Àº ÆÄ±«ÇÒ ¼ö ¾ø½À´Ï´Ù."); return; } + int sell = 0; + for(int n = 0; n < buildingLevel; n++) + { + sell += unitInfo.unit.buy[n]; + } + sell /= 3; + PlayCtrl.Instance.TextUpdate(sell); unitInfo = null; img.sprite = null; img.color = Color.clear; diff --git a/Client/Assets/1_Script/PlayCtrl.cs b/Client/Assets/1_Script/PlayCtrl.cs index 0b67fc62..455463a5 100644 --- a/Client/Assets/1_Script/PlayCtrl.cs +++ b/Client/Assets/1_Script/PlayCtrl.cs @@ -121,8 +121,10 @@ public class PlayCtrl : SingletonMonoBehaviour if (money != int.Parse(moneyText.text)) Debug.LogError("¹ö±×¹ß°ß"); money += addMoney; - if(money < 0 || money > 999900) - Debug.LogError("°¡°Ý¹ö±×¹ß°ß"); + if(money < 0) + money = 0; + else if(money > 999999) + money = 999999; moneyText.text = money.ToString(); } }