Commit e83f329e authored by 18손재민's avatar 18손재민

Merge branch 'enemy'

# Conflicts:
#	Assets/Scripts/Characters/EnemyManager.cs
parents ce71b605 3da70bd7
...@@ -15,14 +15,16 @@ public class EnemyManager : Singleton<EnemyManager> ...@@ -15,14 +15,16 @@ public class EnemyManager : Singleton<EnemyManager>
Attack Attack
} // 상속을 통해 수정할 가능성 높음. 염두만 해 두자. } // 상속을 통해 수정할 가능성 높음. 염두만 해 두자.
public enum ItemType { None, OneStone, TwoStone, ThreeStone, FourStone,
FiveStone, GoldPotion, AmethystPotion, CommonItem, RareItem,
EpicItem, LegendaryItem, CommonAdd, RareAdd, EpicAdd,
LegendaryAdd }
public enum EnemyData { Health, Weight, Height, Width, DetectRange, public enum EnemyData { Health, Weight, Height, Width, DetectRange,
AtkRange, AtkDistance, AtkDelay, PjtSpeed, MoveSpeed, AtkRange, AtkDistance, AtkDelay, PjtSpeed, MoveSpeed,
Damage } //Atk = Attack, Pjt = Projectile(투사체) Damage } //Atk = Attack, Pjt = Projectile(투사체)
/* 기본적으로 각 경우에 대해 가지는 값은 양수일 것
* 하지만 특별한 경우가 있음
* 1. DetectRange(감지 범위) : DetectRange가 -1이면 방 전체를 감지한다는 뜻. -2이면 현재 에너미가 있는 플랫폼 전체, -3이면 플랫폼 전방만 감지를 뜻 함.
* 2. AtkRange(공격 범위) : -1이면 현재 위치한 플랫폼 전체를 의미, -2이면 플랫폼 전방만 의미.
* 3. AtkDistance(공격 사거리) : -1이면 현재 위치한 플랫폼 끝까지 의미.
* 4. AtkDelay(공격 딜레이) : -1이면 무한 즉, 단 1회 공격함.
*/
public delegate void Action(); public delegate void Action();
...@@ -32,12 +34,10 @@ public class EnemyManager : Singleton<EnemyManager> ...@@ -32,12 +34,10 @@ public class EnemyManager : Singleton<EnemyManager>
public readonly Dictionary<int, Dictionary<State, Action>> actionDictByID; public readonly Dictionary<int, Dictionary<State, Action>> actionDictByID;
public readonly Dictionary<int, Dictionary<EnemyData, float>> enemyDataByID; public readonly Dictionary<int, Dictionary<EnemyData, float>> enemyDataByID;
// standard enemy prefab public GameObject enemyPrefab;
public GameObject enemyPrefab; // method
// constructor
// method protected EnemyManager()
// constructor
protected EnemyManager()
{ {
string dropTableDataPath = ""; string dropTableDataPath = "";
string actionTableDataPath = ""; string actionTableDataPath = "";
...@@ -107,7 +107,7 @@ public class EnemyManager : Singleton<EnemyManager> ...@@ -107,7 +107,7 @@ public class EnemyManager : Singleton<EnemyManager>
int.TryParse(cellValue[0], out enemyID); int.TryParse(cellValue[0], out enemyID);
for(int i=0;i<11;i++) for(int i=0;i<11;i++)
{ {
float.TryParse(cellValue[i + 1], out enemyData[i]); float.TryParse(cellValue[i + 2], out enemyData[i]);
} }
for(int i=0;i<12;i++) for(int i=0;i<12;i++)
...@@ -118,12 +118,11 @@ public class EnemyManager : Singleton<EnemyManager> ...@@ -118,12 +118,11 @@ public class EnemyManager : Singleton<EnemyManager>
enemyDataByID.Add(enemyID, EnemyInfo); enemyDataByID.Add(enemyID, EnemyInfo);
} }
} }
// called by gameManager to Spawn enemy
// called by gameManager to Spawn enemy // little temporary. Many change will be exist.
// little temporary. Many change will be exist. public void SpawnEnemy()
public void SpawnEnemy() {
{ Vector2 playerPosition = GameObject.Find("Player").transform.position;
Vector2 playerPosition = GameObject.Find("Player").transform.position; Instantiate(enemyPrefab, playerPosition + new Vector2(7, 0), Quaternion.identity);
Instantiate(enemyPrefab, playerPosition + new Vector2(7, 0), Quaternion.identity); }
}
} }
...@@ -20,3 +20,11 @@ public enum LifeStoneType ...@@ -20,3 +20,11 @@ public enum LifeStoneType
Gold=2, Gold=2,
Amethyst=3 Amethyst=3
} }
public enum ItemType
{
None, OneStone, TwoStone, ThreeStone, FourStone,
FiveStone, GoldPotion, AmethystPotion, StudyItem, OrdinaryItem,
SuperiorItem, MasterPieceItem, StudyAdd, OrdinaryAdd, SuperiorAdd,
MasterpieceAdd
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment