Пример #1
0
 public void OnCollisionEnter(Collision col)
 {
     if (col.collider.CompareTag("Player"))
     {
         healthUi.CurrentNumberofHearts -= 1;
         healthUi.ClearScreen();
     }
 }
Пример #2
0
 public void OnCollisionEnter(Collision col)
 {
     if (col.collider.CompareTag("Player"))
     {
         EnemyTakeDamage(20);
         healthUi.CurrentNumberofHearts -= 1;
         healthUi.ClearScreen();
     }
     if (col.collider.CompareTag("Bullet"))
     {
         EnemyTakeDamage(20);
         Destroy(col.gameObject);
     }
 }
Пример #3
0
 public void takeDamaage()
 {
     healthUi.CurrentNumberofHearts -= 1;
     healthUi.ClearScreen();
 }