Ejemplo n.º 1
0
        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;
                }
            }
        }
Ejemplo n.º 2
0
        public void Start()
        {
            if (IsRecastable())
            {
                if (timeCooldown != null)
                {
                    timeCooldown.ConsumeRecast();
                }
                return;
            }

            currentCharge--;

            //DLog.Log("Current charge: " + currentCharge);
            TimeCooldown cooldown = new TimeCooldown(Duration());

            timeCooldowns.Enqueue(cooldown);
            cooldown.Start();
        }
Ejemplo n.º 3
0
 public TimeCooldownResource(float duration)
 {
     timeCooldown = new TimeCooldown(duration);
 }
Ejemplo n.º 4
0
 public TimeCooldownResource(float duration, float scale = 1)
 {
     timeCooldown = new TimeCooldown(duration, scale);
 }