public EnemyFactory(Transform container, GameObject prefab, Transform player, GameSettings settings) { if (container == null) { throw new ArgumentNullException(nameof(container)); } if (prefab == null) { throw new ArgumentNullException(nameof(prefab)); } if (settings == null) { throw new ArgumentNullException(nameof(settings)); } if (player == null) { throw new ArgumentNullException(nameof(player)); } m_Container = container; m_Prefab = prefab; m_Player = player; m_Settings = settings.EnemySettings; m_Radius = settings.EnemyStartRadius; }
public void Setup(IEnemySettings settings) { m_AttakDistance = settings.AttackDistance; m_DistanceToGo = settings.DistanceToGo; }
protected Enemy(Game game, byte spriteWidth, byte spriteHeight, byte animationStepCount, TimeSpan animationStepTime, TimeSpan attackAnimationStepTime, EPrefab textureName, IEnemySettings settings, Vector2 position) : base(game, spriteWidth, spriteHeight, animationStepCount, animationStepTime, attackAnimationStepTime, textureName, position, Color.White, settings.Hitbox) { _maxHealth = settings.MaxHealth; _health = _maxHealth; _hasPhases = settings.HasPhases; _phasingHealth = settings.PhasingHealth; }