private void SpawnEnemy(bool random) { GameObject enemy = null; if (!random) { Instantiate(Enemies[enemyType], transform.position, transform.rotation); } else { enemyType = (EnemyTypes)Enum.GetValues(enemyType.GetType()).GetValue(UnityEngine.Random.Range(0, 3)); enemy = Instantiate(Enemies[enemyType], transform.position, transform.rotation); } if (randomSpawnLocation) { RandomRelocateSpawner(); } enemyManager.AddEnemy(enemy); enemyCounter++; timeSinceSpawn = 0.0f; }