덱 선택 시스템 db 저장 완료
This commit is contained in:
parent
f5cace6347
commit
9a8fe45a9e
|
|
@ -2660,7 +2660,7 @@ GameObject:
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 0
|
||||||
--- !u!224 &544367043
|
--- !u!224 &544367043
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -345,7 +345,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 0
|
isProduction: 0
|
||||||
lineCount: 3
|
position: 4
|
||||||
|
wave: 3
|
||||||
buildingLevel: 0
|
buildingLevel: 0
|
||||||
--- !u!1 &9912296
|
--- !u!1 &9912296
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -1259,7 +1260,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 0
|
isProduction: 0
|
||||||
lineCount: 0
|
position: 2
|
||||||
|
wave: 0
|
||||||
buildingLevel: 0
|
buildingLevel: 0
|
||||||
--- !u!1 &120981875
|
--- !u!1 &120981875
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -1542,7 +1544,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 0
|
isProduction: 0
|
||||||
lineCount: 3
|
position: 2
|
||||||
|
wave: 3
|
||||||
buildingLevel: 0
|
buildingLevel: 0
|
||||||
--- !u!1 &131930846
|
--- !u!1 &131930846
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -1869,7 +1872,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 0
|
isProduction: 0
|
||||||
lineCount: 1
|
position: 1
|
||||||
|
wave: 1
|
||||||
buildingLevel: 0
|
buildingLevel: 0
|
||||||
--- !u!1 &180016503
|
--- !u!1 &180016503
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -2303,7 +2307,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 0
|
isProduction: 0
|
||||||
lineCount: 1
|
position: 3
|
||||||
|
wave: 1
|
||||||
buildingLevel: 0
|
buildingLevel: 0
|
||||||
--- !u!1 &247032537
|
--- !u!1 &247032537
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -4020,7 +4025,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 0
|
isProduction: 0
|
||||||
lineCount: 3
|
position: 1
|
||||||
|
wave: 3
|
||||||
buildingLevel: 0
|
buildingLevel: 0
|
||||||
--- !u!1 &589201251
|
--- !u!1 &589201251
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -4113,7 +4119,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 1
|
isProduction: 1
|
||||||
lineCount: 4
|
position: 0
|
||||||
|
wave: 4
|
||||||
buildingLevel: 1
|
buildingLevel: 1
|
||||||
--- !u!114 &589201256
|
--- !u!114 &589201256
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
|
@ -4527,7 +4534,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 0
|
isProduction: 0
|
||||||
lineCount: 1
|
position: 4
|
||||||
|
wave: 1
|
||||||
buildingLevel: 0
|
buildingLevel: 0
|
||||||
--- !u!1 &677531638
|
--- !u!1 &677531638
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -5246,7 +5254,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 0
|
isProduction: 0
|
||||||
lineCount: 4
|
position: 3
|
||||||
|
wave: 4
|
||||||
buildingLevel: 0
|
buildingLevel: 0
|
||||||
--- !u!1 &757452403
|
--- !u!1 &757452403
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -6489,7 +6498,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 0
|
isProduction: 0
|
||||||
lineCount: 3
|
position: 3
|
||||||
|
wave: 3
|
||||||
buildingLevel: 0
|
buildingLevel: 0
|
||||||
--- !u!1 &1019007066
|
--- !u!1 &1019007066
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -6582,7 +6592,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 1
|
isProduction: 1
|
||||||
lineCount: 0
|
position: 0
|
||||||
|
wave: 0
|
||||||
buildingLevel: 1
|
buildingLevel: 1
|
||||||
--- !u!114 &1019007071
|
--- !u!114 &1019007071
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
|
@ -6939,7 +6950,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 1
|
isProduction: 1
|
||||||
lineCount: 1
|
position: 0
|
||||||
|
wave: 1
|
||||||
buildingLevel: 1
|
buildingLevel: 1
|
||||||
--- !u!114 &1090203497
|
--- !u!114 &1090203497
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
|
@ -7428,7 +7440,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 0
|
isProduction: 0
|
||||||
lineCount: 0
|
position: 1
|
||||||
|
wave: 0
|
||||||
buildingLevel: 0
|
buildingLevel: 0
|
||||||
--- !u!1 &1149620901
|
--- !u!1 &1149620901
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -7577,7 +7590,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 0
|
isProduction: 0
|
||||||
lineCount: 4
|
position: 2
|
||||||
|
wave: 4
|
||||||
buildingLevel: 0
|
buildingLevel: 0
|
||||||
--- !u!1 &1222833246
|
--- !u!1 &1222833246
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -7801,7 +7815,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 0
|
isProduction: 0
|
||||||
lineCount: 2
|
position: 1
|
||||||
|
wave: 2
|
||||||
buildingLevel: 0
|
buildingLevel: 0
|
||||||
--- !u!1 &1229715544
|
--- !u!1 &1229715544
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -8214,7 +8229,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 1
|
isProduction: 1
|
||||||
lineCount: 2
|
position: 0
|
||||||
|
wave: 2
|
||||||
buildingLevel: 1
|
buildingLevel: 1
|
||||||
--- !u!114 &1314094868
|
--- !u!114 &1314094868
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
|
@ -8720,7 +8736,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 0
|
isProduction: 0
|
||||||
lineCount: 2
|
position: 3
|
||||||
|
wave: 2
|
||||||
buildingLevel: 0
|
buildingLevel: 0
|
||||||
--- !u!1 &1364046232
|
--- !u!1 &1364046232
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -8936,7 +8953,7 @@ GameObject:
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 0
|
||||||
--- !u!224 &1396764733
|
--- !u!224 &1396764733
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -9708,7 +9725,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 0
|
isProduction: 0
|
||||||
lineCount: 2
|
position: 2
|
||||||
|
wave: 2
|
||||||
buildingLevel: 0
|
buildingLevel: 0
|
||||||
--- !u!1 &1463891738
|
--- !u!1 &1463891738
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -10528,7 +10546,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 0
|
isProduction: 0
|
||||||
lineCount: 2
|
position: 4
|
||||||
|
wave: 2
|
||||||
buildingLevel: 0
|
buildingLevel: 0
|
||||||
--- !u!1 &1606282281
|
--- !u!1 &1606282281
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -10921,7 +10940,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 0
|
isProduction: 0
|
||||||
lineCount: 0
|
position: 3
|
||||||
|
wave: 0
|
||||||
buildingLevel: 0
|
buildingLevel: 0
|
||||||
--- !u!1 &1691811517
|
--- !u!1 &1691811517
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -11380,7 +11400,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 0
|
isProduction: 0
|
||||||
lineCount: 0
|
position: 4
|
||||||
|
wave: 0
|
||||||
buildingLevel: 0
|
buildingLevel: 0
|
||||||
--- !u!1 &1765962106
|
--- !u!1 &1765962106
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -11966,7 +11987,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 0
|
isProduction: 0
|
||||||
lineCount: 1
|
position: 2
|
||||||
|
wave: 1
|
||||||
buildingLevel: 0
|
buildingLevel: 0
|
||||||
--- !u!1 &1842952264
|
--- !u!1 &1842952264
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -12143,7 +12165,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 1
|
isProduction: 1
|
||||||
lineCount: 3
|
position: 0
|
||||||
|
wave: 3
|
||||||
buildingLevel: 1
|
buildingLevel: 1
|
||||||
--- !u!114 &1886491696
|
--- !u!114 &1886491696
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
|
@ -12582,7 +12605,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 0
|
isProduction: 0
|
||||||
lineCount: 4
|
position: 4
|
||||||
|
wave: 4
|
||||||
buildingLevel: 0
|
buildingLevel: 0
|
||||||
--- !u!1 &1933741026
|
--- !u!1 &1933741026
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -12806,7 +12830,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isProduction: 0
|
isProduction: 0
|
||||||
lineCount: 4
|
position: 1
|
||||||
|
wave: 4
|
||||||
buildingLevel: 0
|
buildingLevel: 0
|
||||||
--- !u!1 &1960064590
|
--- !u!1 &1960064590
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,8 @@ using UnityEngine.UI;
|
||||||
public class BuildingCtrl : MonoBehaviour
|
public class BuildingCtrl : MonoBehaviour
|
||||||
{
|
{
|
||||||
public bool isProduction;
|
public bool isProduction;
|
||||||
public int lineCount;
|
public int position;
|
||||||
|
public int wave;
|
||||||
public int buildingLevel;
|
public int buildingLevel;
|
||||||
|
|
||||||
UnitCtrl unitInfo;
|
UnitCtrl unitInfo;
|
||||||
|
|
@ -81,7 +82,7 @@ public class BuildingCtrl : MonoBehaviour
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PlayCtrl.Instance.TextUpdate(-unitInfo.unit.buy[buildingLevel]);
|
PlayCtrl.Instance.TextUpdate(-unitInfo.unit.buy[buildingLevel]);
|
||||||
PlayCtrl.Instance.player.buildings[lineCount].units.Add(unitInfo);
|
PlayCtrl.Instance.player.buildings[wave].level[position - 1] = buildingLevel + 1;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
if(500 * buildingLevel > PlayCtrl.Instance.money)
|
if(500 * buildingLevel > PlayCtrl.Instance.money)
|
||||||
|
|
@ -90,7 +91,7 @@ public class BuildingCtrl : MonoBehaviour
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PlayCtrl.Instance.TextUpdate(-500 * buildingLevel);
|
PlayCtrl.Instance.TextUpdate(-500 * buildingLevel);
|
||||||
PlayCtrl.Instance.player.addMoney[lineCount] += 100;
|
PlayCtrl.Instance.player.addMoney[wave] += 100;
|
||||||
}
|
}
|
||||||
buildingLevel++;
|
buildingLevel++;
|
||||||
}
|
}
|
||||||
|
|
@ -115,11 +116,12 @@ public class BuildingCtrl : MonoBehaviour
|
||||||
buildingLevel = 0;
|
buildingLevel = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void NewBuilding(UnitCtrl unitInfo, Sprite unitImg )
|
public void NewBuilding(UnitCtrl unitInfo, Sprite unitImg)
|
||||||
{
|
{
|
||||||
this.unitInfo = unitInfo;
|
this.unitInfo = unitInfo;
|
||||||
img.sprite = unitImg;
|
img.sprite = unitImg;
|
||||||
img.color = Color.white;
|
img.color = Color.white;
|
||||||
|
PlayCtrl.Instance.player.buildings[wave].units[position - 1] = unitInfo;
|
||||||
LevelUp();
|
LevelUp();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,13 @@ using UnityEngine;
|
||||||
|
|
||||||
public class BuildingInfo
|
public class BuildingInfo
|
||||||
{
|
{
|
||||||
public List<UnitCtrl> units = new List<UnitCtrl>();
|
public UnitCtrl[] units;
|
||||||
|
|
||||||
public int level;
|
public int[] level;
|
||||||
|
|
||||||
public BuildingInfo()
|
public BuildingInfo()
|
||||||
{
|
{
|
||||||
level = 1;
|
level = new int[4] { 0, 0, 0, 0 };
|
||||||
|
units = new UnitCtrl[4];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,17 +35,6 @@ public class SummonsUnit : MonoBehaviour
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
PlayCtrl.Instance.player = this;
|
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;
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Summons(int count)
|
public void Summons(int count)
|
||||||
|
|
@ -55,17 +44,18 @@ public class SummonsUnit : MonoBehaviour
|
||||||
if (buildingInfo.units == null)
|
if (buildingInfo.units == null)
|
||||||
return;
|
return;
|
||||||
else
|
else
|
||||||
listCount = buildingInfo.units.Count;
|
listCount = buildingInfo.units.Length;
|
||||||
|
|
||||||
for (int n = 0; n < listCount; n++)
|
for (int n = 0; n < listCount; n++)
|
||||||
{
|
{
|
||||||
for(int m = 0; m < buildingInfo.level; m++)
|
for(int m = 0; m < buildingInfo.level[n]; m++)
|
||||||
{
|
{
|
||||||
float pos = Random.Range(-3.7f, -0.3f);
|
float pos = Random.Range(-3.7f, -0.3f);
|
||||||
if (isEnemy) //Àû¼Òȯ
|
if (isEnemy) //Àû¼Òȯ
|
||||||
Instantiate(buildingInfo.units[n].gameObject, new Vector3(Random.Range(44.0f, 46.0f), pos, pos + 3.8f), Quaternion.identity).GetComponent<UnitCtrl>().UnitBonusSet(isEnemy, buildingInfo.level);
|
Instantiate(buildingInfo.units[n].gameObject, new Vector3(Random.Range(44.0f, 46.0f), pos, pos + 3.8f), Quaternion.identity).GetComponent<UnitCtrl>().UnitBonusSet(isEnemy, buildingInfo.level[n]);
|
||||||
else //¾Æ±º À¯´Ö ¼Òȯ
|
else //¾Æ±º À¯´Ö ¼Òȯ
|
||||||
Instantiate(buildingInfo.units[n].gameObject, new Vector3(Random.Range(-44.0f, -46.0f), pos, pos + 3.8f), Quaternion.identity).GetComponent<UnitCtrl>().UnitBonusSet(isEnemy, buildingInfo.level);
|
Instantiate(buildingInfo.units[n].gameObject, new Vector3(Random.Range(-44.0f, -46.0f), pos, pos + 3.8f), Quaternion.identity).GetComponent<UnitCtrl>().UnitBonusSet(isEnemy, buildingInfo.level[n]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -80,9 +70,16 @@ public class SummonsUnit : MonoBehaviour
|
||||||
List<AI> ai = Statics.excelDatas.GamestageAIList(Statics.chapter, stage);
|
List<AI> ai = Statics.excelDatas.GamestageAIList(Statics.chapter, stage);
|
||||||
for(int n = 0; n < ai.Count; n++)
|
for(int n = 0; n < ai.Count; n++)
|
||||||
{
|
{
|
||||||
buildings[ai[n].wave].units.Add(Statics.units[ai[n].unit].GetComponent<UnitCtrl>());
|
switch (ai[n].command)
|
||||||
//if (ai[n].command.Equals(eCommand.add))
|
{
|
||||||
//units.Add();
|
case eCommand.add:
|
||||||
|
buildings[ai[n].wave].units[ai[n].position - 1] = Statics.stringUnits[ai[n].unit].GetComponent<UnitCtrl>();
|
||||||
|
buildings[ai[n].wave].level[ai[n].position - 1]++;
|
||||||
|
break;
|
||||||
|
case eCommand.upgrade:
|
||||||
|
buildings[ai[n].wave].level[ai[n].position - 1]++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ public class UnitCtrl : MonoBehaviour
|
||||||
public Sprite unitSprite;
|
public Sprite unitSprite;
|
||||||
bool isHomeAttack;
|
bool isHomeAttack;
|
||||||
public BoxCollider2D[] components;
|
public BoxCollider2D[] components;
|
||||||
|
public long tableIndex;
|
||||||
|
|
||||||
List<UnitCtrl> enemyUnits;
|
List<UnitCtrl> enemyUnits;
|
||||||
|
|
||||||
|
|
@ -19,14 +20,18 @@ public class UnitCtrl : MonoBehaviour
|
||||||
|
|
||||||
bool isDie = false;
|
bool isDie = false;
|
||||||
|
|
||||||
public void DataSet(UnitData ud)
|
public void DataSet(long tableIndex)
|
||||||
{
|
{
|
||||||
unit = new UnitInfo(ud);
|
//이곳은 List유닛에게 세팅됨
|
||||||
|
this.tableIndex = tableIndex;
|
||||||
|
unit.UnitSet(Statics.excelDatas.unitData[tableIndex]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UnitBonusSet(bool isEnemy, int unitLevel)
|
public void UnitBonusSet(bool isEnemy, int unitLevel)
|
||||||
{
|
{
|
||||||
|
//이곳은 생성된 유닛에게 세팅됨
|
||||||
this.isEnemy = isEnemy;
|
this.isEnemy = isEnemy;
|
||||||
|
unit.UnitSet(Statics.excelDatas.unitData[tableIndex]);
|
||||||
unit.UnitBonusSet(new UnitBonus(unitLevel, new int[0], 0, 0));
|
unit.UnitBonusSet(new UnitBonus(unitLevel, new int[0], 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class UnitInfo
|
public class UnitInfo
|
||||||
|
|
@ -25,7 +26,7 @@ public class UnitInfo
|
||||||
|
|
||||||
UnitBonus unitBonus;
|
UnitBonus unitBonus;
|
||||||
|
|
||||||
public UnitInfo(UnitData ud)
|
public void UnitSet(UnitData ud)
|
||||||
{
|
{
|
||||||
_name = ud.name;
|
_name = ud.name;
|
||||||
_maxHp = ud.hp;
|
_maxHp = ud.hp;
|
||||||
|
|
@ -49,7 +50,7 @@ public class UnitBonus
|
||||||
//1 > 1.12 > 1.272 > 1.439 > 1.643
|
//1 > 1.12 > 1.272 > 1.439 > 1.643
|
||||||
int _level;
|
int _level;
|
||||||
|
|
||||||
public int level { get { return level; } }
|
public int level { get { return _level; } }
|
||||||
|
|
||||||
public float levelBonus { get { switch (_level)
|
public float levelBonus { get { switch (_level)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
public class MainCtrl : MonoBehaviour
|
public class MainCtrl : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
@ -116,12 +117,25 @@ public class MainCtrl : MonoBehaviour
|
||||||
resp.Request(req, (data) =>
|
resp.Request(req, (data) =>
|
||||||
{
|
{
|
||||||
//로그인 성공시
|
//로그인 성공시
|
||||||
PlayerPrefs.SetString("uuid",data.uuid);
|
if(data.status.Equals(200))
|
||||||
GameManager.Instance.NextScene(GameManager.eScene.Game);
|
{
|
||||||
|
PlayerPrefs.SetString("uuid", data.uuid);
|
||||||
|
List<DeckUnitInfo> units = data.deck_unit;
|
||||||
|
foreach (DeckUnitInfo item in units)
|
||||||
|
{
|
||||||
|
Statics.deckUnit.Add(item.id, item);
|
||||||
|
}
|
||||||
|
Statics.leader = data.leader;
|
||||||
|
GameManager.Instance.NextScene(GameManager.eScene.Game);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PlayerPrefs.SetString("uuid", "");
|
||||||
|
Awake();
|
||||||
|
}
|
||||||
}, () =>
|
}, () =>
|
||||||
{
|
{
|
||||||
PlayerPrefs.SetString("uuid", "");
|
|
||||||
Awake();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ public class PlayCtrl : SingletonMonoBehaviour<PlayCtrl>
|
||||||
public GameObject newBuildingUI;
|
public GameObject newBuildingUI;
|
||||||
public GameObject buildingLevelupUI;
|
public GameObject buildingLevelupUI;
|
||||||
public GameObject backButton;
|
public GameObject backButton;
|
||||||
public UnitCtrl[] units;
|
UnitCtrl[] units;
|
||||||
public TMP_Text buyText;
|
public TMP_Text buyText;
|
||||||
public TMP_Text sellText;
|
public TMP_Text sellText;
|
||||||
public TMP_Text moneyText;
|
public TMP_Text moneyText;
|
||||||
|
|
@ -34,10 +34,6 @@ public class PlayCtrl : SingletonMonoBehaviour<PlayCtrl>
|
||||||
|
|
||||||
public int money;
|
public int money;
|
||||||
|
|
||||||
//선택된 ui의 정보를 저장할 수 있게 만들기.
|
|
||||||
//레벨업 ui만들기
|
|
||||||
//backbutton을 누르면 둘다 꺼지게 만들기.
|
|
||||||
|
|
||||||
protected override void OnAwake()
|
protected override void OnAwake()
|
||||||
{
|
{
|
||||||
summons = 0.1f;
|
summons = 0.1f;
|
||||||
|
|
@ -47,7 +43,17 @@ public class PlayCtrl : SingletonMonoBehaviour<PlayCtrl>
|
||||||
moneyText.text = money.ToString();
|
moneyText.text = money.ToString();
|
||||||
isEndGame = false;
|
isEndGame = false;
|
||||||
delay = 0.0f;
|
delay = 0.0f;
|
||||||
for(int n = 0; n < unitSpriteButton.Length; n++)
|
units = new UnitCtrl[9];
|
||||||
|
units[0] = Statics.intUnits[Statics.deckUnit[Statics.leader[0].deck_unit0_id].unit_id].GetComponent<UnitCtrl>();
|
||||||
|
units[1] = Statics.intUnits[Statics.deckUnit[Statics.leader[0].deck_unit1_id].unit_id].GetComponent<UnitCtrl>();
|
||||||
|
units[2] = Statics.intUnits[Statics.deckUnit[Statics.leader[0].deck_unit2_id].unit_id].GetComponent<UnitCtrl>();
|
||||||
|
units[3] = Statics.intUnits[Statics.deckUnit[Statics.leader[0].deck_unit3_id].unit_id].GetComponent<UnitCtrl>();
|
||||||
|
units[4] = Statics.intUnits[Statics.deckUnit[Statics.leader[0].deck_unit4_id].unit_id].GetComponent<UnitCtrl>();
|
||||||
|
units[5] = Statics.intUnits[Statics.deckUnit[Statics.leader[0].deck_unit5_id].unit_id].GetComponent<UnitCtrl>();
|
||||||
|
units[6] = Statics.intUnits[Statics.deckUnit[Statics.leader[0].deck_unit6_id].unit_id].GetComponent<UnitCtrl>();
|
||||||
|
units[7] = Statics.intUnits[Statics.deckUnit[Statics.leader[0].deck_unit7_id].unit_id].GetComponent<UnitCtrl>();
|
||||||
|
units[8] = Statics.intUnits[Statics.deckUnit[Statics.leader[0].deck_unit8_id].unit_id].GetComponent<UnitCtrl>();
|
||||||
|
for (int n = 0; n < unitSpriteButton.Length; n++)
|
||||||
{
|
{
|
||||||
unitSpriteButton[n].sprite = units[n].unitSprite;
|
unitSpriteButton[n].sprite = units[n].unitSprite;
|
||||||
unitTextButton[n].text = units[n].unit.buy[0].ToString();
|
unitTextButton[n].text = units[n].unit.buy[0].ToString();
|
||||||
|
|
|
||||||
|
|
@ -44,14 +44,14 @@ public class GameManager : DontDestroy<GameManager>
|
||||||
|
|
||||||
private void UnitDataSet()
|
private void UnitDataSet()
|
||||||
{
|
{
|
||||||
Statics.units = new Dictionary<string, GameObject>();
|
|
||||||
foreach (var data in Statics.excelDatas.unitData)
|
foreach (var data in Statics.excelDatas.unitData)
|
||||||
{
|
{
|
||||||
GameObject obj = Resources.Load<GameObject>($"Unit/{data.Value.name}");
|
GameObject obj = Resources.Load<GameObject>($"Unit/{data.Value.name}");
|
||||||
if (obj != null)
|
if (obj != null)
|
||||||
{
|
{
|
||||||
obj.GetComponent<UnitCtrl>().DataSet(data.Value);
|
obj.GetComponent<UnitCtrl>().DataSet(data.Key);
|
||||||
Statics.units.Add(data.Value.name, obj);
|
Statics.stringUnits.Add(data.Value.name, obj);
|
||||||
|
Statics.intUnits.Add(data.Value.index, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
using BestHTTP;
|
using BestHTTP;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
public enum Protocol
|
public enum Protocol
|
||||||
{
|
{
|
||||||
//0~100 테스트용 프로토콜
|
//0~100 임시 프로토콜
|
||||||
Test = 0,
|
Test = 0,
|
||||||
AddUser = 1,
|
AddUser = 1,
|
||||||
|
|
||||||
|
|
@ -13,7 +14,7 @@ public enum Protocol
|
||||||
|
|
||||||
|
|
||||||
Downlode = 100,//±âȹ µ¥ÀÌÅÍ ´Ù¿î·Îµå
|
Downlode = 100,//±âȹ µ¥ÀÌÅÍ ´Ù¿î·Îµå
|
||||||
Login = 101,//기획 데이터 다운로드
|
Login = 101,//유저 로그인
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 100 : Downlode
|
#region 100 : Downlode
|
||||||
|
|
@ -58,10 +59,35 @@ public class LoginResp : Request<LoginResp>
|
||||||
private Protocol protocol = Protocol.Login;
|
private Protocol protocol = Protocol.Login;
|
||||||
public string uuid { get; set; }
|
public string uuid { get; set; }
|
||||||
public string nickname { get; set; }
|
public string nickname { get; set; }
|
||||||
|
public List<DeckUnitInfo> deck_unit { get; set; }
|
||||||
|
public List<LeaderInfo> leader { get; set; }
|
||||||
|
|
||||||
public void Request(LoginReq loginReq, Action<LoginResp> onRequestFinished, Action errorRequestFinished)
|
public void Request(LoginReq loginReq, Action<LoginResp> onRequestFinished, Action errorRequestFinished)
|
||||||
{
|
{
|
||||||
CreateRequest(protocol, onRequestFinished, loginReq, HTTPMethods.Post, errorRequestFinished);
|
CreateRequest(protocol, onRequestFinished, loginReq, HTTPMethods.Post, errorRequestFinished);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class DeckUnitInfo
|
||||||
|
{
|
||||||
|
public int id { get; set; }
|
||||||
|
public int unit_id { get; set; }
|
||||||
|
public int user_id { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class LeaderInfo
|
||||||
|
{
|
||||||
|
public int id { get; set; }
|
||||||
|
public int leader_id { get; set; }
|
||||||
|
public int deck_unit0_id { get; set; }
|
||||||
|
public int deck_unit1_id { get; set; }
|
||||||
|
public int deck_unit2_id { get; set; }
|
||||||
|
public int deck_unit3_id { get; set; }
|
||||||
|
public int deck_unit4_id { get; set; }
|
||||||
|
public int deck_unit5_id { get; set; }
|
||||||
|
public int deck_unit6_id { get; set; }
|
||||||
|
public int deck_unit7_id { get; set; }
|
||||||
|
public int deck_unit8_id { get; set; }
|
||||||
|
public int user_id { get; set; }
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
@ -35,10 +35,8 @@ public class Request<T>
|
||||||
|| string.IsNullOrEmpty(response.DataAsText) //서버에서 반환 데이터 없음
|
|| string.IsNullOrEmpty(response.DataAsText) //서버에서 반환 데이터 없음
|
||||||
|| response.DataAsText.Contains("error")) //서버에서 처리 중 에러 반환
|
|| response.DataAsText.Contains("error")) //서버에서 처리 중 에러 반환
|
||||||
{
|
{
|
||||||
//Protocols.Error error = JsonConvert.DeserializeObject<Protocols.Error>(response.DataAsText);
|
|
||||||
Debug.LogError("status : " + response.StatusCode);
|
Debug.LogError("status : " + response.StatusCode);
|
||||||
//Debug.LogError("error : " + error.error);
|
|
||||||
//Debug.LogError("error_description : " + error.error_description);
|
|
||||||
if (errorRequestFinished != null)
|
if (errorRequestFinished != null)
|
||||||
{
|
{
|
||||||
errorRequestFinished();
|
errorRequestFinished();
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,15 @@ public class Statics
|
||||||
|
|
||||||
public static ExcelDatas excelDatas;
|
public static ExcelDatas excelDatas;
|
||||||
|
|
||||||
public static Dictionary <string,GameObject> units = new Dictionary<string,GameObject>();
|
public static Dictionary <string, GameObject> stringUnits = new Dictionary<string,GameObject>();
|
||||||
|
public static Dictionary <int, GameObject> intUnits = new Dictionary<int,GameObject>();
|
||||||
|
|
||||||
|
//유저가 갖고있는 유닛들
|
||||||
|
public static Dictionary<int, DeckUnitInfo> deckUnit = new Dictionary<int, DeckUnitInfo>();
|
||||||
|
|
||||||
|
//유저가 세팅한 덱 정보
|
||||||
|
public static List<LeaderInfo> leader;
|
||||||
|
|
||||||
|
//유저가 플레이한 쳅터 정보
|
||||||
public static int chapter;
|
public static int chapter;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue