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