Exemple #1
0
    public void TakeDamage(float damage)
    {
        currentHealth -= damage;
        flash.FlashDamage();

        if (currentHealth <= 0 && !isDead)
        {
            currentHealth = 0;
            maxHealth     = 0;
            isDead        = true;
            plm.enabled   = false;
            Invoke("DeadScene", 3f);
        }
    }