public void Update(float dt)
        {
            if (timeCooldown == null)
            {
                if (timeCooldowns.Count > 0)
                {
                    timeCooldown = timeCooldowns.Dequeue();
                }
            }

            if (timeCooldown != null)
            {
                if (adjust)
                {
                    adjust = false;
                    timeCooldown.AdjustRemainingWithRatio(ratio);
                }

                timeCooldown.Update(dt);
                if (timeCooldown.IsComplete())
                {
                    currentCharge++;
                    //DLog.Log("Recover charge, current: " + currentCharge);
                    timeCooldown = null;
                }
            }
        }
Exemple #2
0
 public override bool IsAvailable()
 {
     return(timeCooldown.IsComplete() || timeCooldown.IsRecastable());
 }