private IEnumerator PlayDeathAnimation() { onDeathExplosion.TurnOnExplosions(); yield return(new WaitForSeconds(explosionTimer)); onDeathExplosion.TurnOffExplosions(); BossPhaseTwo newBossPhase = Instantiate(bossTwoPrefab, transform.position, transform.rotation); newBossPhase.InitializePhase(missileTurretOne, missileTurretTwo, scatterTurretOne, scatterTurretTwo, enemiesOnScreen); Destroy(gameObject); }
// Use this for initialization void Start() { if (instance == null) { instance = this; } else { Destroy(gameObject); } hitBox = gameObject.GetComponent <Collider2D>(); myColorFlash = gameObject.GetComponent <ColorFlash>(); hangers = gameObject.GetComponentsInChildren <HangerBaySpawn>(); player = FindObjectOfType <Player>(); flashOutTimePlayed = transitionOutFlashAmount; flashInTimePlayed = transitionInFlashAmount; lastFlashTime = timeBetweenFlashes; lastSpawn = spawnTimer; isDead = false; }