Example #1
0
 // This function reports two sets of collision hulls to their respective parents (if possible)
 public static void ReportCollisionToParent(CollisionHull2D shapeA, CollisionHull2D shapeB)
 {
     // If yes, then inform the parents of the complex shape object (if applicable)
     if (shapeA.transform.parent != null)
     {
         shapeA.GetComponentInParent <ParentCollisionScript>().ReportCollisionToParent();
     }
     if (shapeB.transform.parent != null)
     {
         shapeB.GetComponentInParent <ParentCollisionScript>().ReportCollisionToParent();
     }
 }