private void checkIfDead()
 {
     if (PlayerHealthPoints <= 0)
     {
         deathHandler.HandleDeath();
     }
 }
Example #2
0
 // Update is called once per frame
 void FixedUpdate()
 {
     if (transform.position.y < deathHeight)
     {
         DeathHandler.HandleDeath(gameObject);
     }
 }
Example #3
0
 void IfDeadKillPlayer()
 {
     if (hitPoints <= 0)
     {
         deathHandler.HandleDeath();
     }
 }
Example #4
0
 private void BeginTimer()
 {
     countdownTimerInSeconds -= Time.deltaTime;
     if (countdownTimerInSeconds <= 0)
     {
         deathHandler.HandleDeath();
     }
 }
Example #5
0
 public void TakeDamage(float damage)
 {
     health -= damage;
     if (health <= Mathf.Epsilon)
     {
         deathHandler.HandleDeath();
     }
 }
Example #6
0
 public void PlayerTakeDamage(int damageIn)
 {
     playerDamage   -= damageIn;
     healthText.text = playerDamage.ToString() + maxHP;
     if (playerDamage <= 0)
     {
         DeathHandler deathHandler = GetComponent <DeathHandler>();
         deathHandler.HandleDeath();
     }
 }
Example #7
0
    public void TakeDamage(float damage)
    {
        playerHealth -= damage;
        myDamageDisplay.ShowDamageImpact();

        if (playerHealth <= 0)
        {
            print("Player has died");
            myDeathHandler.HandleDeath();
        }
    }
    public void HandleDamage(float damage)
    {
        if (isDead)
        {
            return;
        }

        curHP -= damage;

        if (curHP <= 0)
        {
            isDead = true;
            deathHandler.HandleDeath();
            return;
        }

        //Hit Reaction Effect
        hitReactionObject.StartHitReaction();
    }