unity cooldown timer
// Very light and easy to use cooldown tool for unity:
// https://github.com/JosepeDev/CooldownAPI
void Attack()
{
// some attack behaviour
...
// cooldown activation
attackCooldown.Activate();
}
if (//if player is pressing the attack button)
{
// prevent the player from attacking when cooldown active
if (attackCooldown.IsActive == false)
{
Attack();
}
}