Beispiel #1
0
    void BossDied(GameObject bossObject)
    {
        ImportantPeopleDied(bossObject);

        // make player invincible then destroy all the enemies
        player.GetComponent <HealthSystem>().immune = true;

        foreach (GameObject enemy in GameObject.FindGameObjectsWithTag("Enemy"))
        {
            DeathSystem enemyDeath = enemy.GetComponent <DeathSystem>();
            if (enemyDeath != null)
            {
                enemyDeath.KillDelayed(Random.Range(0.5f, 1.5f));
            }
            else
            {
                Destroy(enemy);
            }
        }
    }