//a method that starts the attack cooldown: public void StartCoolDown() { if (coolDownEnabled == true) //only if the cooldown option is enabled { coolDownTimer = coolDownDuration; CoolDownActive = true; CustomEvents.OnAttackCooldownUpdated(this, Target); } }
//method that updates the cooldown void UpdateCoolDown() { if (coolDownTimer > 0) //cooldown timer { coolDownTimer -= Time.deltaTime; } else { CoolDownActive = false; CustomEvents.OnAttackCooldownUpdated(this, Target); } }