void Start() { fusionManager = FindObjectOfType <FusionManager>(); enemyBuildingScript = GetComponent <EnemyBuildingScript>(); enemySpawnScript = GetComponent <EnemySpawnScript>(); audi = GetComponent <AudioSource>(); spawnPosition = enemySpawnScript.GetSpawnPosition(); }
private void SpawnStrongest() { if (!enemyBuildingScript.GetStrongestSpawned(strongestSpawnNum) && stageManager.GetCurrentStage() != 0 && stageManager.GetCurrentStage() % 5 == 0 && enemyBuildingScript.getHe() <= enemyBuildingScript.getFirstHe() * enemyBuildingScript.strongestSpawnPerHp[strongestSpawnNum]) { enemyBuildingScript.SetstrongestSpawned(strongestSpawnNum, true); Instantiate(enemyBuildingScript.GetStrongest(strongestSpawnNum), enemySpawnScript.GetSpawnPosition()); audi.clip = spawnStrongestSound; audi.Play(); foreach (var item in fusionManager.unitScript) { item.MoveBack(); } spawnStrongestEnergy.SetActive(true); } }