protected virtual void PauseGameplay()
 {
     if (pauseWhileOpen)
     {
         previousTimeScale = Time.timeScale;
         Time.timeScale    = 0;
     }
     if (unlockCursorWhileOpen)
     {
         wasCursorActive = Tools.IsCursorActive();
         Tools.SetCursorActive(true);
     }
 }