Using the mana in the Lambda

I positioned the UseMana call before running TargetAcquired, thereby reducing the number of GetComponent calls. Any potential issues with this approach?

targetingStrategy.StartTargeting(data,
 () =>
 {
  if (!mana.UseMana(manaCost)) return;
  TargetAcquired(data);
 });

The only pitfall I can see is that if the ability is cancelled, the mana will still have been spent. :slight_smile:

1 Like

Privacy & Terms