private void spawnEnemy(EnemyLevels _enemyL) { Vector3 posToSpawn = new Vector3(Random.Range(-8f, 8f), 7, 0); // new - wave esting GameObject newRot = Instantiate(_rotPrefab, posToSpawn, Quaternion.identity); // new - quizz //GameObject newEnemy = Instantiate(_enemyPrefab, posToSpawn, Quaternion.identity); // course-1a newRot.transform.parent = _enemyContainer.transform; // GameObject newEnemy = Instantiate(Enemies[enemyLevel], posToSpawn, Quaternion.identity); GameObject newEnemy = Instantiate(Enemies[_enemyL], posToSpawn, Quaternion.identity); if (enemyLevel != EnemyLevels.Boss) { newEnemy.transform.parent = newRot.transform; } else { Debug.LogError("I am fighting boss !!"); } // newEnemy.transform.parent = _enemyContainer.transform; // old - course-1a //newEnemy.SendMessage("setName", SpawnID); // HOW TO MAKE IT WORK WITH SPAWN ID IN ENEMY.CS ? numEnemy++; spawnedEnemy++; }
private void Optimising(EnemyLevels eL, bool wS, int nE, int nW) //, bool sH) { enemyLevel = eL; waveSpawn = wS; numEnemy = nE; numWaves = nW; // isShielded = sH; Debug.Log("We are in LEVEL " + eL); }
// spawns an enemy based on the enemy level that you selected private void spawnEnemy() { // Edited/ added by Nikolaj Sloth int spawnPointIndex = Random.Range(0, spawnPoints.Length); if (enemyStrengthSize >= 3) { enemyLevel = EnemyLevels.Medium; GameObject Enemy = (GameObject)Instantiate(Enemies[enemyLevel], spawnPoints[spawnPointIndex].position, Quaternion.identity); } else { GameObject Enemy = (GameObject)Instantiate(Enemies[enemyLevel], spawnPoints[spawnPointIndex].position, Quaternion.identity); } // //Enemy.SendMessage("setName", SpawnID); // Increase the total number of enemies spawned and the number of spawned enemies numEnemy++; spawnedEnemy++; }
// spawns an enemy based on the enemy level that you selected private void spawnEnemy() { // Edited/ added by Nikolaj Sloth int spawnPointIndex = Random.Range(0, spawnPoints.Length); if (enemyStrengthSize >= 3) { enemyLevel = EnemyLevels.Medium; GameObject Enemy = (GameObject)Instantiate(Enemies[enemyLevel], spawnPoints[spawnPointIndex].position, Quaternion.identity); } else { GameObject Enemy = (GameObject)Instantiate(Enemies[enemyLevel], spawnPoints[spawnPointIndex].position, Quaternion.identity); } // //Enemy.SendMessage("setName", SpawnID); // Increase the total number of enemies spawned and the number of spawned enemies numEnemy++; spawnedEnemy++; }