diff --git a/Assets/Scripts/EnemyManager.cs b/Assets/Scripts/EnemyManager.cs index 0c45ec639577f62a1e8c414fb40d4a0f2e343da0..850b3ad57fd3d0a0973a2260f6d9a3ad3d87f5e9 100644 --- a/Assets/Scripts/EnemyManager.cs +++ b/Assets/Scripts/EnemyManager.cs @@ -75,6 +75,19 @@ public class EnemyManager : Singleton<EnemyManager> return (EnemyDeadCount == EnemySpawnCount); } + public int CountEnemyInMap() + { + int cnt = 0; + foreach(Transform obj in MapManager.currentRoom.transform) + { + if (obj.gameObject.CompareTag("enemy")) + { + cnt++; + } + } + return cnt; + } + // Object Pool private void CreateEnemyPool() {