Ejemplo n.º 1
0
 // TODO clean code practices suggests PauseGame() and ResumeGame() are separate functions.
 public void PauseGame(bool gamePaused)
 {
     _bPaused = gamePaused;
     if (_bPaused)
     {
         _savedVelocity = _playerRigidBody.velocity;
         _playerRigidBody.Sleep();
         Fog.Pause();
     }
     else
     {
         _playerRigidBody.WakeUp();
         _playerRigidBody.velocity = _savedVelocity;
         Fog.Resume();
     }
     _anim.enabled = !gamePaused;
     Lantern.GamePaused(gamePaused);
     AbilitiesPaused(gamePaused);
 }