Example #1
0
    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);
        }
    }
Example #2
0
 // 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;
             }
         }
     }
 }