Ejemplo n.º 1
0
    public void PlayerTakeDamage()
    {
        if (lastHitTime + playerHitImmunityTime > Time.time)
        {
            return;
        }

        Debug.Log("Player took damage!");
        playerCurrentLives--;

        lastHitTime = Time.time;

        lifePanel.SetCurrentLives(playerCurrentLives);

        if (playerCurrentLives == 0)
        {
            OnDeath();
        }
    }