Answers for "unity cooldown timer"

C#
5

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();
  }
}
Posted by: Guest on August-19-2021

C# Answers by Framework

Browse Popular Code Answers by Language