0.0마지막 버전 작업완료
This commit is contained in:
parent
3d3910b8cc
commit
aceff3ddb5
|
|
@ -32,16 +32,16 @@ public class SummonsUnit : MonoBehaviour
|
|||
else
|
||||
PlayCtrl.Instance.player = this;
|
||||
|
||||
//테스트용
|
||||
if (isEnemy)
|
||||
{
|
||||
List<UnitCtrl> units = new List<UnitCtrl>();
|
||||
for (int m = 0; m < 5; m++)
|
||||
{
|
||||
units.Add(Statics.units["AxeGoblin"].GetComponent<UnitCtrl>());
|
||||
}
|
||||
buildings[0].units = units;
|
||||
}
|
||||
////Å×½ºÆ®¿ë
|
||||
//if (isEnemy)
|
||||
//{
|
||||
// List<UnitCtrl> units = new List<UnitCtrl>();
|
||||
// for (int m = 0; m < 5; m++)
|
||||
// {
|
||||
// units.Add(Statics.units["AxeGoblin"].GetComponent<UnitCtrl>());
|
||||
// }
|
||||
// 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> 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<UnitCtrl>());
|
||||
//if (ai[n].command.Equals(eCommand.add))
|
||||
//units.Add();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,10 @@ public class PlayCtrl : SingletonMonoBehaviour<PlayCtrl>
|
|||
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<PlayCtrl>
|
|||
slider.value -= 1;
|
||||
summons = 0.1f;
|
||||
stage++;
|
||||
enemy.EnemyStageSet(stage);
|
||||
}
|
||||
if (summons < slider.value)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,19 @@ public class ExcelDatas
|
|||
yield return Timing.WaitForSeconds(0);
|
||||
action();
|
||||
}
|
||||
|
||||
public List<AI> GamestageAIList(int chapter, int stage)
|
||||
{
|
||||
List<AI> data = new List<AI>();
|
||||
foreach (var item in ai)
|
||||
{
|
||||
if(item.Value.chapter == chapter && item.Value.stage == stage)
|
||||
{
|
||||
data.Add(item.Value);
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class Excel
|
||||
|
|
|
|||
|
|
@ -12,4 +12,5 @@ public class Statics
|
|||
|
||||
public static Dictionary <string,GameObject> units = new Dictionary<string,GameObject>();
|
||||
|
||||
public static int chapter;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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")]
|
||||
|
|
|
|||
Loading…
Reference in New Issue