Beispiel #1
0
    // Enemy health lost
    public void EnemyHealthDown()
    {
        screenShake.Shake(0.05f, -20f);
        currentEnemyHealth -= 1f;
        float calculateHealth = currentEnemyHealth / maxEnemyHealth;

        SetHealth(calculateHealth);

        if (currentEnemyHealth <= 400 && currentEnemyHealth >= 201)
        {
            // swap to bullet pattern
            BossAttacks[0].SetActive(false);
            BossAttacks[1].SetActive(true);
        }

        if (currentEnemyHealth <= 200)
        {
            BossAttacks[1].SetActive(false);
            BossAttacks[2].SetActive(true);
            //swap to bullet pattern 2
        }

        if (currentEnemyHealth <= 0f)
        {
            Debug.Log("death");
            deathRoutine.DeathRoutine();
            Destroy(this.gameObject);
            EventManager.TriggerEvent("LevelWon");
        }
        deathRoutine.OnHitAudio();
    }
Beispiel #2
0
    // Enemy health lost and screenshake
    public void MinionHealthDown()
    {
        screenShake.Shake(0.05f, -20f);
        currentEnemyHealth -= 1f;


        if (currentEnemyHealth <= 0f)
        {
            enemyDeath.DeathRoutine();
            Destroy(this.gameObject);
        }
        enemyDeath.OnHitAudio();
    }