From 0f3d7535cb3e721803f89d4505fad14a0dc9df05 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:45:34 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=90=EC=9B=90=EC=86=8C=EB=AA=A8=20?= =?UTF-8?q?=EC=8B=9C=EC=8A=A4=ED=85=9C=20=EC=9E=91=EC=97=85=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Client/Assets/1_Script/Info/BuildingCtrl.cs | 22 ++++++++++++++++++++- Client/Assets/1_Script/Info/SummonsUnit.cs | 10 +++++++--- Client/Assets/1_Script/Info/UnitInfo.cs | 1 + Client/Assets/1_Script/PlayCtrl.cs | 2 ++ Client/Assets/3_Prefab/Unit 0.prefab | 1 + Client/Assets/3_Prefab/Unit 1.prefab | 1 + Client/Assets/3_Prefab/Unit 2.prefab | 1 + Client/Assets/3_Prefab/Unit 3.prefab | 1 + Client/Assets/3_Prefab/Unit 4.prefab | 1 + Client/Assets/3_Prefab/Unit 5.prefab | 1 + Client/Assets/3_Prefab/Unit 6.prefab | 1 + Client/Assets/3_Prefab/Unit 7.prefab | 1 + Client/Assets/3_Prefab/Unit 8.prefab | 1 + 13 files changed, 40 insertions(+), 4 deletions(-) diff --git a/Client/Assets/1_Script/Info/BuildingCtrl.cs b/Client/Assets/1_Script/Info/BuildingCtrl.cs index d0666930..3a882431 100644 --- a/Client/Assets/1_Script/Info/BuildingCtrl.cs +++ b/Client/Assets/1_Script/Info/BuildingCtrl.cs @@ -54,7 +54,27 @@ public class BuildingCtrl : MonoBehaviour Debug.Log("°Ç¹°ÀÌ ÃÖ´ë ·¹º§ ÀÔ´Ï´Ù."); return; } - PlayCtrl.Instance.player.buildings[lineCount].units.Add(unitInfo); + if (!isProduction) + { + if(unitInfo.unit.buy[buildingLevel] > PlayCtrl.Instance.money) + { + Debug.Log("±¸¸Åºñ¿ëÀÌ ºÎÁ·ÇÕ´Ï´Ù"); + if (buildingLevel == 0) + DeletBuilding(); + return; + } + PlayCtrl.Instance.TextUpdate(-unitInfo.unit.buy[buildingLevel]); + PlayCtrl.Instance.player.buildings[lineCount].units.Add(unitInfo); + } else + { + if(500 * buildingLevel > PlayCtrl.Instance.money) + { + Debug.Log("±¸¸Åºñ¿ëÀÌ ºÎÁ·ÇÕ´Ï´Ù"); + return; + } + PlayCtrl.Instance.TextUpdate(-500 * buildingLevel); + PlayCtrl.Instance.player.addMoney[lineCount] += 100; + } buildingLevel++; } diff --git a/Client/Assets/1_Script/Info/SummonsUnit.cs b/Client/Assets/1_Script/Info/SummonsUnit.cs index c477af75..302f3855 100644 --- a/Client/Assets/1_Script/Info/SummonsUnit.cs +++ b/Client/Assets/1_Script/Info/SummonsUnit.cs @@ -7,8 +7,7 @@ public class SummonsUnit : MonoBehaviour public List buildings; public int campHp; - //Å×½ºÆ®¿ëµµ - public UnitCtrl unit; + public int[] addMoney; private void Awake() { @@ -19,6 +18,11 @@ public class SummonsUnit : MonoBehaviour buildings.Add(new BuildingInfo()); buildings.Add(new BuildingInfo()); buildings.Add(new BuildingInfo()); + addMoney = new int[5]; + for(int n = 0; n < addMoney.Length; n++) + { + addMoney[n] = 100; + } } private void Start() @@ -58,7 +62,7 @@ public class SummonsUnit : MonoBehaviour } if (!isEnemy)//ÀÚ¿ø »ý¼º { - PlayCtrl.Instance.TextUpdate(100); + PlayCtrl.Instance.TextUpdate(addMoney[count]); } } } diff --git a/Client/Assets/1_Script/Info/UnitInfo.cs b/Client/Assets/1_Script/Info/UnitInfo.cs index fb7ec3ff..ce93ec1f 100644 --- a/Client/Assets/1_Script/Info/UnitInfo.cs +++ b/Client/Assets/1_Script/Info/UnitInfo.cs @@ -9,4 +9,5 @@ public class UnitInfo public float attackSpeed; public int defense; public float moveSpeed; + public int[] buy; } diff --git a/Client/Assets/1_Script/PlayCtrl.cs b/Client/Assets/1_Script/PlayCtrl.cs index 9e20517b..0b67fc62 100644 --- a/Client/Assets/1_Script/PlayCtrl.cs +++ b/Client/Assets/1_Script/PlayCtrl.cs @@ -121,6 +121,8 @@ public class PlayCtrl : SingletonMonoBehaviour if (money != int.Parse(moneyText.text)) Debug.LogError("¹ö±×¹ß°ß"); money += addMoney; + if(money < 0 || money > 999900) + Debug.LogError("°¡°Ý¹ö±×¹ß°ß"); moneyText.text = money.ToString(); } } diff --git a/Client/Assets/3_Prefab/Unit 0.prefab b/Client/Assets/3_Prefab/Unit 0.prefab index e99dd043..efc39cac 100644 --- a/Client/Assets/3_Prefab/Unit 0.prefab +++ b/Client/Assets/3_Prefab/Unit 0.prefab @@ -55,6 +55,7 @@ MonoBehaviour: attackSpeed: 2 defense: 0 moveSpeed: 5 + buy: 320000006400000096000000c8000000fa000000 anim: {fileID: 95137492731099486} defensObj: {fileID: 6875975714746273136} isEnemy: 0 diff --git a/Client/Assets/3_Prefab/Unit 1.prefab b/Client/Assets/3_Prefab/Unit 1.prefab index e6dda780..9fa749cc 100644 --- a/Client/Assets/3_Prefab/Unit 1.prefab +++ b/Client/Assets/3_Prefab/Unit 1.prefab @@ -879,6 +879,7 @@ MonoBehaviour: attackSpeed: 2 defense: 20 moveSpeed: 5 + buy: 64000000c80000002c01000090010000f4010000 anim: {fileID: 95025121907886038} defensObj: {fileID: 2560953789813459005} isEnemy: 0 diff --git a/Client/Assets/3_Prefab/Unit 2.prefab b/Client/Assets/3_Prefab/Unit 2.prefab index a5259612..069df64e 100644 --- a/Client/Assets/3_Prefab/Unit 2.prefab +++ b/Client/Assets/3_Prefab/Unit 2.prefab @@ -2624,6 +2624,7 @@ MonoBehaviour: attackSpeed: 3 defense: 50 moveSpeed: 6 + buy: c8000000900100005802000020030000e8030000 anim: {fileID: 95139002667318946} defensObj: {fileID: 689331061546745630} isEnemy: 0 diff --git a/Client/Assets/3_Prefab/Unit 3.prefab b/Client/Assets/3_Prefab/Unit 3.prefab index e0a96e90..f6e5e8d8 100644 --- a/Client/Assets/3_Prefab/Unit 3.prefab +++ b/Client/Assets/3_Prefab/Unit 3.prefab @@ -992,6 +992,7 @@ MonoBehaviour: attackSpeed: 2 defense: 50 moveSpeed: 3 + buy: 320000006400000096000000c8000000fa000000 anim: {fileID: 95921515561157426} defensObj: {fileID: 4728842467067653097} isEnemy: 0 diff --git a/Client/Assets/3_Prefab/Unit 4.prefab b/Client/Assets/3_Prefab/Unit 4.prefab index bc703706..aded315e 100644 --- a/Client/Assets/3_Prefab/Unit 4.prefab +++ b/Client/Assets/3_Prefab/Unit 4.prefab @@ -1195,6 +1195,7 @@ MonoBehaviour: attackSpeed: 2 defense: 100 moveSpeed: 3 + buy: 64000000c80000002c01000090010000f4010000 anim: {fileID: 95699734256526290} defensObj: {fileID: 358225386609479139} isEnemy: 0 diff --git a/Client/Assets/3_Prefab/Unit 5.prefab b/Client/Assets/3_Prefab/Unit 5.prefab index 9b7dadb7..42a603f6 100644 --- a/Client/Assets/3_Prefab/Unit 5.prefab +++ b/Client/Assets/3_Prefab/Unit 5.prefab @@ -2410,6 +2410,7 @@ MonoBehaviour: attackSpeed: 2 defense: 150 moveSpeed: 3 + buy: c8000000900100005802000020030000e8030000 anim: {fileID: 95057529936190960} defensObj: {fileID: 1996079076997718765} isEnemy: 0 diff --git a/Client/Assets/3_Prefab/Unit 6.prefab b/Client/Assets/3_Prefab/Unit 6.prefab index 93b531b0..d26bcf0a 100644 --- a/Client/Assets/3_Prefab/Unit 6.prefab +++ b/Client/Assets/3_Prefab/Unit 6.prefab @@ -171,6 +171,7 @@ MonoBehaviour: attackSpeed: 2 defense: 10 moveSpeed: 3 + buy: 320000006400000096000000c8000000fa000000 anim: {fileID: 95900925144019084} defensObj: {fileID: 1912811255609939500} isEnemy: 0 diff --git a/Client/Assets/3_Prefab/Unit 7.prefab b/Client/Assets/3_Prefab/Unit 7.prefab index 2930f188..b7451c11 100644 --- a/Client/Assets/3_Prefab/Unit 7.prefab +++ b/Client/Assets/3_Prefab/Unit 7.prefab @@ -1067,6 +1067,7 @@ MonoBehaviour: attackSpeed: 2 defense: 30 moveSpeed: 3 + buy: 64000000c80000002c01000090010000f4010000 anim: {fileID: 95649635967823240} defensObj: {fileID: 209849273209592232} isEnemy: 0 diff --git a/Client/Assets/3_Prefab/Unit 8.prefab b/Client/Assets/3_Prefab/Unit 8.prefab index 7a1236b3..422a105d 100644 --- a/Client/Assets/3_Prefab/Unit 8.prefab +++ b/Client/Assets/3_Prefab/Unit 8.prefab @@ -2740,6 +2740,7 @@ MonoBehaviour: attackSpeed: 3 defense: 100 moveSpeed: 3 + buy: c8000000900100005802000020030000e8030000 anim: {fileID: 95893142771630846} defensObj: {fileID: 3031819780035806523} isEnemy: 0