void OnTriggerEnter2D(Collider2D gameObj) //collision detection { if (gameObj.gameObject.tag == "enemy") { extAudio.PlayStompSound(); Destroy(gameObj); } }
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); } }