重构清理敌人类
This commit is contained in:
+9
-3
@@ -22,7 +22,6 @@ namespace SepCore.EnemyManager
|
||||
public IReadOnlyCollection<EntityBase> Enemies => _enemyRegistry.Enemies;
|
||||
|
||||
private int _spawnEnemyMaxCount;
|
||||
private int _spawnDistanceFromPlayer;
|
||||
|
||||
private int _currentSpawnEnemyId;
|
||||
private int _currentLevel;
|
||||
@@ -73,11 +72,18 @@ namespace SepCore.EnemyManager
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_entity.HasEntityGroup(EnemyGroupName))
|
||||
{
|
||||
Log.Error("Entity group '{0}' does not exist.", EnemyGroupName);
|
||||
return;
|
||||
}
|
||||
|
||||
_isStopped = false;
|
||||
_spawnEnemyMaxCount = GameEntry.Luban.Global.SpawnEnemyMaxCount;
|
||||
_spawnDistanceFromPlayer = GameEntry.Luban.Global.SpawnDistanceFromPlayer / 1000;
|
||||
float minDistance = GameEntry.Luban.Global.EnemySpawnDistanceMin / 1000f;
|
||||
float maxDistance = GameEntry.Luban.Global.EnemySpawnDistanceMax / 1000f;
|
||||
_player = player.CachedTransform;
|
||||
_spawnPositionStrategy = new RandomCircleSpawnStrategy(_spawnDistanceFromPlayer);
|
||||
_spawnPositionStrategy = new RandomCircleSpawnStrategy(minDistance, maxDistance);
|
||||
|
||||
_baseDuration = level.Duration;
|
||||
_duration = _baseDuration;
|
||||
|
||||
Reference in New Issue
Block a user