Example #1
0
        //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);
            }
        }
Example #2
0
        //method that updates the cooldown
        void UpdateCoolDown()
        {
            if (coolDownTimer > 0) //cooldown timer
            {
                coolDownTimer -= Time.deltaTime;
            }
            else
            {
                CoolDownActive = false;

                CustomEvents.OnAttackCooldownUpdated(this, Target);
            }
        }