Пример #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag("Player"))
     {
         Damage();
     }
     void Damage()
     {
         healthController.playerHealth = healthController.playerHealth - SpikeDamage;
         healthController.UpdateHealth();
         this.gameObject.SetActive(false);
     }
 }
 void Move()
 {
     healthController.playerHealth = healthController.playerHealth - bombDamage;
     healthController.UpdateHealth();
     SoundManagerScript.PlaySound("hit");
 }
Пример #3
0
 void Damage()
 {
     healthController.playerHealth = healthController.playerHealth - vDamage;
     healthController.UpdateHealth();
     this.gameObject.SetActive(false);
 }
Пример #4
0
 public void Damage()
 {
     healthController.currentHealth = healthController.currentHealth - damage;
     healthController.UpdateHealth();
     this.gameObject.SetActive(false);
 }