void OnCollisionEnter2D(Collision2D col)
 {
     if (col.gameObject.tag == "Breaker")
     {
         l.move(15f);
         Destroy(col.gameObject);
         Destroy(gameObject);
     }
 }
Exemple #2
0
 void OnCollisionEnter2D(Collision2D col)
 {
     if (col.gameObject.tag == "attack")
     {
         if (hits != 0)
         {
             //transform.position = Vector3.Lerp(transform.localPosition, transform.localPosition - new Vector3(0, 2, 0), 1f);
             hits -= 1;
             if (hits == 0)
             {
                 l.move(5f);
             }
         }
     }
 }