public GameObject GetRandomEnemyByFloorDepth(Constants.FloorDepthName floor) { List <GameObject> options = GetAllEnemiesByFloorDepth(floor); int randomIndex = Random.Range(0, options.Count); return(options[randomIndex]); }
public List <GameObject> GetAllEnemiesByFloorDepth(Constants.FloorDepthName floor) { List <GameObject> results = new List <GameObject>(); int count = allEnemies.Count; for (int i = 0; i < count; i++) { if (allEnemies[i].possibleLocations.Contains(floor)) { results.Add(allEnemies[i].enemyPrefab); } } return(results); }