Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     ShouldPause();
     _totalUpdateTime += Time.deltaTime;
     _gameTime         = _fixedGameTime;
     for (int i = 0; i < _managers.Count; i++)
     {
         _managers [i].UpdateManager(_gameTime, Time.deltaTime);
     }
     if (Input.GetKeyDown(KeyCode.Backspace))
     {
         Observe();
     }
     if (_activeCharacter != null)
     {
         _activeCharacter.Target();
     }
     if (_canAcceptPlayerInput)
     {
         PlayerInput.CheckSpeedButtons();
     }
     if (_canAcceptPlayerInput && _activeCharacter != null && _isPlaying)
     {
         _activeCharacter.FaceCamera();
         _activeCharacter.SetStateToKeyboard();
         _activeCharacter.SetAction(PlayerInput.ActionButtons(_activeCharacter));
         _activeCharacter.ApplyActions();
     }
     foreach (WibblyWobbly _timey in _timeyWimeys)
     {
         if (_gameSpeed >= 0)
         {
             _timey.PlayVisuals(_gameTime);
         }
         else
         {
             _timey.RewindVisuals(_gameTime);
         }
     }
     TimeCounter.UpdateTime(_fixedGameTime);
     _camController.UpdateCamera();
     UpdateFixedTimestep();
     if (_loadLevel)
     {
         LoadNextLevel();
     }
 }