Пример #1
0
 void OnTriggerEnter2D(Collider2D gameObj)     //collision detection
 {
     if (gameObj.gameObject.tag == "enemy")
     {
         extAudio.PlayStompSound();
         Destroy(gameObj);
     }
 }
Пример #2
0
 void OnTriggerEnter2D(Collider2D gameObj)     //collision detection
 {
     if (gameObj.gameObject.tag == "Death")
     {
         Destroy(gameObject);
     }
     if (gameObj.gameObject.tag == "playerFeet" && !playerDead)
     {
         isDead = true;
         extAudio.PlayStompSound();
         Destroy(gameObject);
     }
     if (gameObj.gameObject.tag == "Bullet")
     {
         isDead = true;
         Destroy(gameObject);
     }
 }