Ejemplo n.º 1
0
 private static void CheckCollision()
 {
     for (int i = 0; i < physicalObjects.Count - 1; i++)
     {
         IPhysical physical1 = physicalObjects[i];
         if (physical1 != null)
         {
             for (int j = i + 1; j < physicalObjects.Count; j++)
             {
                 IPhysical physical2 = physicalObjects[j];
                 if (physical2 != null)
                 {
                     if (PhysicsManager.Intersect(physical1.BoxCollider, physical2.BoxCollider))
                     {
                         physical1.OnIntersect(physical2);
                         physical2.OnIntersect(physical1);
                     }
                 }
             }
         }
     }
 }