Exemplo n.º 1
0
 public static unsafe void GatheredHitProcessor(MPWorld world, int numHits, MPHitData *hits)
 {
     for (int i = 0; i < numHits; ++i)
     {
         if (hits[i].num_hits == 0)
         {
             continue;
         }
         GameObject            col = world.colliders[i];
         RedirectForceToParent cp  = col.GetComponent <RedirectForceToParent>();
         if (cp)
         {
             Transform parent = col.transform.parent;
             if (parent)
             {
                 MPUtils.CallGathereditHandler(world, parent.gameObject, ref hits[i]);
             }
         }
         else
         {
             MPUtils.CallGathereditHandler(world, col, ref hits[i]);
         }
     }
 }
Exemplo n.º 2
0
 public static unsafe void DefaultGatheredHitProcessor(MPWorld world, int numColliders, MPHitData *hits)
 {
     for (int i = 0; i < numColliders; ++i)
     {
         if (hits[i].num_hits > 0)
         {
             GameObject          col   = world.colliders[i];
             MPColliderAttribute cattr = col.GetComponent <MPColliderAttribute>();
             if (cattr)
             {
                 cattr.gatheredHitHandler(world, col, ref hits[i]);
             }
         }
     }
 }