void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.tag == "EnemyCar") { Destroy(gameObject); ui.GameOverActivated(); } }
void OnCollisionEnter2D(Collision2D col) { if (col.gameObject.tag == "Enemy car") { Destroy(gameObject); ui.GameOverActivated(); am.carSound.Stop(); am.skidSound.Play(); } }
void OnCollisionEnter2D(Collision2D col) { if (col.gameObject) { anim.SetBool("die", true); UI.GameOverActivated(); rb.velocity = Vector2.zero; am.Stop(); } }