Exemple #1
0
 void FixedUpdate()
 {
     if (Vehicle)
     {
         _input.ApplyInput();
     }
 }
 private void Predict()
 {
     foreach (var playerAction in _inputManager.Inputs())
     {
         PlayerInput.ApplyInput(gameObject, playerAction);
     }
 }
 // Update is called once per frame
 private void FixedUpdate()
 {
     lock (_inputManager) {
         foreach (var playerAction in _inputManager.Inputs())
         {
             if (!ServerGameManager.Instance.IsPlayerDead(GetComponent <OtherPlayer>().id))
             {
                 _lastAppliedInput = PlayerInput.ApplyInput(gameObject, playerAction);
             }
         }
         _inputManager.EmptyAll(_lastAppliedInput);
         LastState = new PlayerPosition(Time.time, transform.position, _lastAppliedInput, GetComponent <Health> ().GetCurrentHealth());
     }
 }