From 6efe663f80adb0d1be9af610e905a727bbf8d921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=8C=90=EB=8F=8C?= Date: Wed, 8 Nov 2023 06:54:39 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B2=8C=EC=9E=84=20=ED=94=8C=EB=A0=88?= =?UTF-8?q?=EC=9D=B4=201=EC=82=AC=EC=9D=B4=ED=81=B4=20=EC=99=84=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Client/Assets/0_Scenes/Game.unity | 27 ++++++++++++++++++++- Client/Assets/1_Script/GameCtrl.cs | 11 +++++++++ Client/Assets/1_Script/GameCtrl.cs.meta | 11 +++++++++ Client/Assets/1_Script/Info/BuildingCtrl.cs | 20 +++++++++++---- Client/Assets/1_Script/Info/UnitCtrl.cs | 2 ++ Client/Assets/1_Script/PlayCtrl.cs | 20 ++++++++------- 6 files changed, 76 insertions(+), 15 deletions(-) create mode 100644 Client/Assets/1_Script/GameCtrl.cs create mode 100644 Client/Assets/1_Script/GameCtrl.cs.meta diff --git a/Client/Assets/0_Scenes/Game.unity b/Client/Assets/0_Scenes/Game.unity index 4b18d34e..2e5ab069 100644 --- a/Client/Assets/0_Scenes/Game.unity +++ b/Client/Assets/0_Scenes/Game.unity @@ -253,6 +253,7 @@ GameObject: m_Component: - component: {fileID: 54711397} - component: {fileID: 54711396} + - component: {fileID: 54711398} m_Layer: 0 m_Name: Camera m_TagString: Untagged @@ -326,6 +327,18 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &54711398 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 54711394} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f97d481d44cb90a469c35682cc60c385, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &84361459 GameObject: m_ObjectHideFlags: 0 @@ -1829,7 +1842,19 @@ MonoBehaviour: m_TargetGraphic: {fileID: 704811668} m_OnClick: m_PersistentCalls: - m_Calls: [] + m_Calls: + - m_Target: {fileID: 54711398} + m_TargetAssemblyTypeName: GameCtrl, Assembly-CSharp + m_MethodName: StartPlay + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!114 &440143456 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Client/Assets/1_Script/GameCtrl.cs b/Client/Assets/1_Script/GameCtrl.cs new file mode 100644 index 00000000..902b0632 --- /dev/null +++ b/Client/Assets/1_Script/GameCtrl.cs @@ -0,0 +1,11 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class GameCtrl : MonoBehaviour +{ + public void StartPlay() + { + GameManager.Instance.NextScene(GameManager.eScene.Play); + } +} diff --git a/Client/Assets/1_Script/GameCtrl.cs.meta b/Client/Assets/1_Script/GameCtrl.cs.meta new file mode 100644 index 00000000..e1c9a7e7 --- /dev/null +++ b/Client/Assets/1_Script/GameCtrl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f97d481d44cb90a469c35682cc60c385 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/1_Script/Info/BuildingCtrl.cs b/Client/Assets/1_Script/Info/BuildingCtrl.cs index 1ab8f03e..35785675 100644 --- a/Client/Assets/1_Script/Info/BuildingCtrl.cs +++ b/Client/Assets/1_Script/Info/BuildingCtrl.cs @@ -33,13 +33,23 @@ public class BuildingCtrl : MonoBehaviour { if(isProduction || buildingLevel != 0)//»ý»ê°Ç¹° À̰ųª ÀϹݰǹ° ·¹º§¾÷ { - int sell = 0; - for (int n = 0; n < buildingLevel; n++) + + if (!isProduction) { - sell += unitInfo.unit.buy[n]; + int sell = 0; + for (int n = 0; n < buildingLevel; n++) + { + sell += unitInfo.unit.buy[n]; + } + sell /= 3; + PlayCtrl.Instance.LevelupBuyAndSellText(unitInfo.unit.buy[buildingLevel], sell); } - sell /= 3; - PlayCtrl.Instance.LevelupBuyAndSellText(unitInfo.unit.buy[buildingLevel], sell); + else + { + PlayCtrl.Instance.LevelupBuyAndSellText(500 * buildingLevel, 0); + } + + PlayCtrl.Instance.buildingLevelupUI.SetActive(true); PlayCtrl.Instance.newBuildingUI.SetActive(false); PlayCtrl.Instance.backButton.SetActive(true); diff --git a/Client/Assets/1_Script/Info/UnitCtrl.cs b/Client/Assets/1_Script/Info/UnitCtrl.cs index e4f144a1..d4da4a30 100644 --- a/Client/Assets/1_Script/Info/UnitCtrl.cs +++ b/Client/Assets/1_Script/Info/UnitCtrl.cs @@ -44,6 +44,7 @@ public class UnitCtrl : MonoBehaviour PlayCtrl.Instance.player.campHp -= unit.attack; if(PlayCtrl.Instance.player.campHp <= 0) { + Debug.Log("ÆÐ¹è!"); PlayCtrl.Instance.isEndGame = true; } } @@ -52,6 +53,7 @@ public class UnitCtrl : MonoBehaviour PlayCtrl.Instance.enemy.campHp -= unit.attack; if (PlayCtrl.Instance.enemy.campHp <= 0) { + Debug.Log("½Â¸®!"); PlayCtrl.Instance.isEndGame = true; } } diff --git a/Client/Assets/1_Script/PlayCtrl.cs b/Client/Assets/1_Script/PlayCtrl.cs index 18571b0f..556ae833 100644 --- a/Client/Assets/1_Script/PlayCtrl.cs +++ b/Client/Assets/1_Script/PlayCtrl.cs @@ -31,6 +31,7 @@ public class PlayCtrl : SingletonMonoBehaviour public SummonsUnit enemy; public BuildingCtrl buildingCtrl; public bool isEndGame; + private float delay; public int money; @@ -46,6 +47,7 @@ public class PlayCtrl : SingletonMonoBehaviour money = 0; moneyText.text = money.ToString(); isEndGame = false; + delay = 0.0f; uiExit(); } @@ -62,7 +64,12 @@ public class PlayCtrl : SingletonMonoBehaviour { if (isEndGame) { - Debug.Log("°ÔÀÓÁ¾·á"); + delay += Time.deltaTime; + if(delay > 3.0f) + { + //°ÔÀÓ¾ÀÀ¸·Î À̵¿ + GameManager.Instance.NextScene(GameManager.eScene.Game); + } return; } float deltaTime = Time.deltaTime; @@ -92,6 +99,8 @@ public class PlayCtrl : SingletonMonoBehaviour } + + public void uiExit() { newBuildingUI.SetActive(false); @@ -135,11 +144,4 @@ public class PlayCtrl : SingletonMonoBehaviour money = 999999; moneyText.text = money.ToString(); } -} -/* - ÇÊ¿ä ÀÛ¾÷»çÇ× - //1. À¯´Ö »ý¼º ÀÚ¿ø - //2. °­È­ Á¶°Ç Á¤Çϱâ - //3. °Ç¹° ö°Å ¹ÝȯÀÚ¿ø Á¶°Ç Á¤Çϱâ - 4. UIÀû¿ë - */ \ No newline at end of file +} \ No newline at end of file