private void SpawnEnemy(EnemySpawnInformation enemySpawnInformation) { switch (enemySpawnInformation.enemyAircraftType) { case EnemyAircraftType.Bomber: SpawnEnemyBomber(enemySpawnInformation); break; } }
private void SpawnEnemyBomber(EnemySpawnInformation enemySpawnInformation) { Transform tf = GetSpawner(enemySpawnInformation.SpawnerNumber); GameObject enemyAircraftObject = Instantiate(enemyBomberPrefab, tf.position, Quaternion.identity); EnemyAircraftScript enemyAircraftScript = enemyAircraftObject.GetComponent <EnemyAircraftScript>(); enemyAircraftScript.gameManager = gameManager; enemyAircraftScript.maxHealth = enemySpawnInformation.MaxHealth; enemyAircraftScript.bombDamage = enemySpawnInformation.bombDamage; enemyAircraftScript.enemyAim = enemySpawnInformation.enemyAim; enemyAircraftScript.enemySpawnerScript = this; enemyAircraftScript.SetAircraftSpeedInMoveHandler(enemySpawnInformation.Speed); enemySpawnInformationsLocal.RemoveAt(enemySpawnInformationsLocal.IndexOf(enemySpawnInformation)); }