private void SpawnEnemy() { currentWaveLength--; timeBetweenSpawns = spawnSettings.AdditionalWaveTimePerEnemy; EnemyMain newEnemy = factory.Create( new EnemyMain.Settings { Health = spawnSettings.InitialHealth + healthIncremental, Damage = spawnSettings.InitialDamage + damageIncremental, Reward = spawnSettings.InitialReward + rewardIncremental, Speed = spawnSettings.Speed, Path = spawnSettings.Path }, spawnSettings.StartingPosition ); EventBus.FireEvent <EnemySpawnedEvent>(new EnemySpawnedEvent() { Enemy = newEnemy }); newEnemy.transform.SetParent(enemiesContainer); }
protected virtual void SetComponent() { mainComponent = GetComponent <EnemyMain>(); mainComponent.StartEvent += OnStart; mainComponent.DisableEvent += OnEnemyDisabled; }