示例#1
0
    public void ApplyDamage(Damage damage)
    {
        if (godmode)
        {
            return;
        }

        if (health <= damage.amount)
        {
            health = 0;
        }
        else
        {
            health -= damage.amount;
        }

        if (inGameUi != null)
        {
            inGameUi.UpdateHealthBar(health, maxHealth);
        }
    }