Example #1
0
    public void TakeDamage(float amount)
    {
        currentHealth -= amount;
        FloatingText.DamagePopup(transform.position, (int)amount, 0, false);

        healthBar.fillAmount = currentHealth / maxHealth;

        if (currentHealth <= 0)
        {
            Die();
        }
    }