how would you guys approach integrating input buffering with this implementation? The goal is to do _ability.Perform(), then if the player presses input again within a specific buffer, then trigger _ability.Perform() again BUT only after the 1st Perform is complete. I have a bool indicating start and end with isPerformingAbility
public class DashAbility : Ability {
private readonly Player _player;
private readonly IDash _ability;
private readonly IInput _input;
public DashAbility(Player player, IDash ability, IInput input) {
_player = player;
_ability = ability;
_input = input;
_input.OnDash += TryAbility;
}
public override void TryAbility() {
if (!NeedsMet()) return;
_ability.Perform();
}
private bool NeedsMet() => _player.CanDash;
}