private void OnCollisionEnter2D(Collision2D collision) { ParticleSystem p = Instantiate(explosion, transform.position, Quaternion.identity); p.Play(); if (collision.gameObject.tag == "starship") { deathManager.Kill(collision.gameObject); Destroy(gameObject); } }
// Pour deathTouch private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.tag == "starship") { AudioManagerForOneGame.am.PlaySound("Contact"); if (deathTouchOn) { outlineSR.color = Color.black; deathTouchOn = false; deathManager.Kill(collision.gameObject); if (shipSpeed != baseShipSpeed) { outlineSR.color = Color.green; } } } }