重构清理敌人类

This commit is contained in:
2026-09-15 11:07:01 +08:00
parent 421f8bf619
commit 88ed35e757
34 changed files with 568 additions and 457 deletions
@@ -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;