public void AttemptToSetNewClosestGravityField(Attractor potentialClosest, float distance)
 {
     if (_closest == null)
     {
         _closest = potentialClosest;
         _nearestSqrDistanceFound = distance;
         return;
     }
     if (distance < _nearestSqrDistanceFound)
     {
         _closest = potentialClosest;
         _nearestSqrDistanceFound = distance;
     }
 }
示例#2
0
 public void RemoveGravityAction(Attractor gravityField)
 {
     _attractorApplyingForce.Remove(gravityField);
 }
示例#3
0
 public void AddGravityAction(Attractor gravityField)
 {
     _attractorApplyingForce.AddIfNotContain(gravityField);
 }
 /// <summary>
 /// return true if this GravityFieldAction is actually the closest one to the player
 /// </summary>
 public bool IsTheValidOneInTheGroup(Attractor toTest)
 {
     return(toTest == _closest);
 }
 public void ResetGroup()
 {
     _closest = null;
 }