Esempio n. 1
0
 /// <summary>
 /// Finds which edge collision occured on and moves child object with parent
 /// </summary>
 /// <param name="collision">Collision2D</param>
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.collider.CompareTag("player 2"))
     {
         Collision2DSideTypeMultiplayer collisionSide = collision.GetContactSideMultiplayer();
         if (collisionSide == Collision2DSideTypeMultiplayer.Top)
         {
             collision.collider.transform.SetParent(transform);
         }
     }
 }