Exemple #1
0
 public bool TryToEat(IEatable toEat)
 {
     if (CanEat(toEat) && Vector2.Distance(transform.position, toEat.GetTransform().position) <= ActualDisplayMass * EatRadiusMult)
     {
         toEat.OnEaten();
         Mass += toEat.GetMass();
         return true;
     }
     else
     {
         return false;
     }
 }