private void SaveCollisionEnterData(EventManager.EDCollisionEnter event1, EventManager.EDCollisionEnter event2)
    {
        // create collision data
        CollEnterDataBundle collEnterData1 = new CollEnterDataBundle(event1);
        CollEnterDataBundle collEnterData2 = new CollEnterDataBundle(event2);

        // calculate collision momentum if desired
        if (event1.momentumCalcRequired || event2.momentumCalcRequired)
        {
            // calculate collision momentum for non static objects
            if (!event1.interactionCont.SupportsInteraction(INTERACTION.COLL_IS_STATIC))
            {
                collEnterData1.collMomentum = GetCollMomentum(event1.collision2D, event1.collisionCont);
            }
            if (!event2.interactionCont.SupportsInteraction(INTERACTION.COLL_IS_STATIC))
            {
                collEnterData2.collMomentum = GetCollMomentum(event2.collision2D, event2.collisionCont);
            }
        }

        // create the internal data
        CollisionEnterDataInternal internalData = new CollisionEnterDataInternal(collEnterData1, collEnterData2);

        internalCollEnterData.Add(internalData);

        // save collision enter data for both objects
        SaveDataHelper <CollisionEnterDataInternal, CollEnterDataBundle, CollisionEnterData>(event1.interactionCont, event2.interactionCont,
                                                                                             internalData, collEnterData1, collEnterData2, AddCollisionEnterDataToInfoBundle);
        SaveDataHelper <CollisionEnterDataInternal, CollEnterDataBundle, CollisionEnterData>(event2.interactionCont, event1.interactionCont,
                                                                                             internalData, collEnterData2, collEnterData1, AddCollisionEnterDataToInfoBundle);
    }
 private void PrintCollData(CollEnterDataBundle data)
 {
     Debug.Log("gameobject: " + data.interactionCont.gameObject.name);
     Debug.Log("collision cont: " + data.collisionCont.GetInstanceID());
     Debug.Log("collider: " + data.collision.collider);
     foreach (Coll2DContactPoint point in data.collision.contacts)
     {
         Debug.Log("contact point: " + point.point + " " + point.normal + " " + point.otherCollider.name + " " + point.collider.name);
     }
     Debug.Log("relative vel: " + data.collision.relativeVelocity);
 }
 public CollisionEnterDataInternal(CollEnterDataBundle collEnterDataBundle1, CollEnterDataBundle collEnterDataBundle2)
 {
     this.collEnterDataBundle1 = collEnterDataBundle1;
     this.collEnterDataBundle2 = collEnterDataBundle2;
 }