diff --git a/Client/Assets/1_Script/Info/SummonsUnit.cs b/Client/Assets/1_Script/Info/SummonsUnit.cs index 374f342d..08e8c616 100644 --- a/Client/Assets/1_Script/Info/SummonsUnit.cs +++ b/Client/Assets/1_Script/Info/SummonsUnit.cs @@ -32,16 +32,16 @@ public class SummonsUnit : MonoBehaviour else PlayCtrl.Instance.player = this; - //Å×½ºÆ®¿ë - if (isEnemy) - { - List units = new List(); - for (int m = 0; m < 5; m++) - { - units.Add(Statics.units["AxeGoblin"].GetComponent()); - } - buildings[0].units = units; - } + ////Å×½ºÆ®¿ë + //if (isEnemy) + //{ + // List units = new List(); + // for (int m = 0; m < 5; m++) + // { + // units.Add(Statics.units["AxeGoblin"].GetComponent()); + // } + // buildings[0].units = units; + //} } public void Summons(int count) @@ -66,4 +66,17 @@ public class SummonsUnit : MonoBehaviour PlayCtrl.Instance.TextUpdate(addMoney[count]); } } + + public void EnemyStageSet(int stage) + { + List ai = Statics.excelDatas.GamestageAIList(Statics.chapter, stage); + for(int n = 0; n < ai.Count; n++) + { + int wave = ai[n].position / 10; + //int pos = ai[n].position % 10; + buildings[wave].units.Add(Statics.units[ai[n].unit].GetComponent()); + //if (ai[n].command.Equals(eCommand.add)) + //units.Add(); + } + } } diff --git a/Client/Assets/1_Script/PlayCtrl.cs b/Client/Assets/1_Script/PlayCtrl.cs index d9c9f7f7..b3f601a8 100644 --- a/Client/Assets/1_Script/PlayCtrl.cs +++ b/Client/Assets/1_Script/PlayCtrl.cs @@ -52,6 +52,10 @@ public class PlayCtrl : SingletonMonoBehaviour unitSpriteButton[n].sprite = units[n].unitSprite; unitTextButton[n].text = units[n].unit.buy[0].ToString(); } + //Å×½ºÆ®¿ë ÀÏ´ÜÀº À̰÷¿¡¼­ Àӽà ó¸® + Statics.chapter = 101; + //0½ºÅ×ÀÌÁö¿¡¼­µµ µ¥ÀÌÅÍ ¼¼ÆÃÀ» ÇÒ¼ö ÀÖ°Ô ¼öÁ¤ + enemy.EnemyStageSet(stage); uiExit(); } @@ -92,6 +96,7 @@ public class PlayCtrl : SingletonMonoBehaviour slider.value -= 1; summons = 0.1f; stage++; + enemy.EnemyStageSet(stage); } if (summons < slider.value) { diff --git a/Client/Assets/1_Script/System/Datas/AI.cs b/Client/Assets/1_Script/System/Datas/AI.cs index 14e61e98..b94a4256 100644 --- a/Client/Assets/1_Script/System/Datas/AI.cs +++ b/Client/Assets/1_Script/System/Datas/AI.cs @@ -4,8 +4,8 @@ using System.Collections.Generic; public class AI : Excel { public int index; + public int chapter; public int stage; - public int wave; public eCommand command; public string unit; public int position; diff --git a/Client/Assets/1_Script/System/Datas/ExcelDatas.cs b/Client/Assets/1_Script/System/Datas/ExcelDatas.cs index b97bb420..3b481f45 100644 --- a/Client/Assets/1_Script/System/Datas/ExcelDatas.cs +++ b/Client/Assets/1_Script/System/Datas/ExcelDatas.cs @@ -20,6 +20,19 @@ public class ExcelDatas yield return Timing.WaitForSeconds(0); action(); } + + public List GamestageAIList(int chapter, int stage) + { + List data = new List(); + foreach (var item in ai) + { + if(item.Value.chapter == chapter && item.Value.stage == stage) + { + data.Add(item.Value); + } + } + return data; + } } public abstract class Excel diff --git a/Client/Assets/1_Script/System/Statics.cs b/Client/Assets/1_Script/System/Statics.cs index 85a05baa..2e30bee7 100644 --- a/Client/Assets/1_Script/System/Statics.cs +++ b/Client/Assets/1_Script/System/Statics.cs @@ -12,4 +12,5 @@ public class Statics public static Dictionary units = new Dictionary(); + public static int chapter; } diff --git a/Client/Assets/1_Script/Test.cs b/Client/Assets/1_Script/Test.cs index 64b86e24..617eaec2 100644 --- a/Client/Assets/1_Script/Test.cs +++ b/Client/Assets/1_Script/Test.cs @@ -17,6 +17,13 @@ public class Test : MonoBehaviour // Debug.Log(cr.Decompress(data.data)); // Statics.version = data.version; //}); + int test = 1; + int wave = test / 10; + int pos = test % 10; + + + Debug.Log(wave); + Debug.Log(pos); } [ContextMenu("test2")]