public void Reset() { EnergyClock.Start(); AddEnergyTimer.Stop(); EnergyFullClock.Stop(); CurrentEnergy = 0f; UseEnergyTimer.Stop(); UseEnergyShadowTimer.Stop(); NopeTimer.Stop(); }
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(); }
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); }