public void CheckSprite()
 {
     if (bossHealthManager.GetHealth() < Constantes.AVERAGE_HEALTH * bossHealthManager.GetOriginalHealth())
     {
         gameObject.GetComponent <SpriteRenderer>().sprite = bossSprites[1];
     }
     if (bossHealthManager.GetHealth() < Constantes.LOW_HEALTH * bossHealthManager.GetOriginalHealth())
     {
         gameObject.GetComponent <SpriteRenderer>().sprite = bossSprites[2];
     }
 }
예제 #2
0
 private void CheckHealth()
 {
     if (bossHealthManager.GetHealth() <= 0)
     {
         stopMoving = true;
         StopFire();
         AddCash();
         TriggerEndLevelEvents();
         return;
     }
 }
예제 #3
0
    public void updateBosslifeBarUI()
    {
        float bossHealth         = bossHealthManager.GetHealth();
        float bossOriginalHealth = bossHealthManager.GetOriginalHealth();

        bossLifeBar.value = bossHealth;

        if (bossHealth < Constantes.AVERAGE_HEALTH * bossOriginalHealth)
        {
            bossLifeBarFill.color = Color.yellow;
        }
        if (bossHealth < Constantes.LOW_HEALTH * bossOriginalHealth)
        {
            bossLifeBarFill.color = Color.red;
        }
        if (bossHealth >= Constantes.AVERAGE_HEALTH * bossOriginalHealth)
        {
            bossLifeBarFill.color = Color.green;
        }
    }