Exemplo n.º 1
0
 private void omnomnom(Bubble bubbleOther, bool forceAbsorbation)
 {
     if (forceAbsorbation || bubbleOther.GetRadius(true) < _bubble.GetRadius(true))
     {
         float radius = bubbleOther.GetRadiusTarget();
         if (radius <= absorbationStep)
         {
             _bubble.ChangeRadius(radius);
             Destroy(bubbleOther.gameObject);
         }
         else
         {
             bubbleOther.ChangeRadius(-absorbationStep);
             float delta = radius - bubbleOther.GetRadiusTarget();
             if (delta < absorbationStep)
             {
                 _bubble.ChangeRadius(radius);
                 Destroy(bubbleOther.gameObject);
             }
             else
             {
                 _bubble.ChangeRadius(absorbationStep);
             }
         }
     }
 }