Пример #1
0
 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);
 }
Пример #4
0
 /// <summary>
 /// return true if this GravityFieldAction is actually the closest one to the player
 /// </summary>
 public bool IsTheValidOneInTheGroup(Attractor toTest)
 {
     return(toTest == _closest);
 }
Пример #5
0
 public void ResetGroup()
 {
     _closest = null;
 }