Пример #1
0
    private void ApplyDamage(float damage)
    {
        health -= damage;
        if (healthbar != null)
        {
            healthbar.SetHealth(health);
        }

        if (health <= 0)
        {
            healthbar.Hide();
        }
    }