Exemplo n.º 1
0
 private void Update()
 {
     if (_playerMovement.CollectsEnergy && _playerMovement.IsAffectingByField && (_playerMovement.Energy != _playerMovement.EnergyMaximum))
     {
         RemainingTime += _timeGainMultiplierWhenCharging * Time.deltaTime;
         if (RemainingTime > _maxTime)
         {
             RemainingTime = _maxTime;
         }
     }
     else
     {
         RemainingTime -= Time.deltaTime;
         if (RemainingTime < 0)
         {
             RemainingTime = 0;
             _playerDeath.TakeDamage();
         }
     }
 }