示例#1
0
 public void Reset()
 {
     EnergyClock.Start();
     AddEnergyTimer.Stop();
     EnergyFullClock.Stop();
     CurrentEnergy = 0f;
     UseEnergyTimer.Stop();
     UseEnergyShadowTimer.Stop();
     NopeTimer.Stop();
 }
示例#2
0
        public override void Update(GameClock time)
        {
            base.Update(time);

            //update all timers
            EnergyClock.Update(time);
            AddEnergyTimer.Update(time);
            EnergyFullClock.Update(time);
            UseEnergyTimer.Update(time);
            UseEnergyShadowTimer.Update(time);
            NopeTimer.Update(time);
            UpdateEnergyFull();
        }
示例#3
0
        public void AddEnergy(float energy)
        {
            //is the player already being healed?
            if (!AddEnergyTimer.HasTimeRemaining)
            {
                PreAddAmount = CurrentEnergy;
            }
            else
            {
                PreAddAmount = PreAddAmount + ((CurrentEnergy - PreAddAmount) * (1 - AddEnergyTimer.Lerp));
            }

            //start the healing timer
            AddEnergyTimer.Start(AddEnergyTimeDelta);
        }