// Apply physics forces public void FixedUpdate() { /* * var moveVector = new Vector3(); * foreach(var key in _movementControls.Keys) * { * if (Input.GetKey(key)) * { * moveVector += _movementControls[key]; * } * } * * ui.move=moveVector; */ ui.move = new Vector3( Input.GetAxis("Vertical"), //<- move.x: forward direction (WS keys) 0.0f, //<- move.y: upward direction -Input.GetAxis("Horizontal") //<- move.z: turning left (AD keys) ); ui.action = Input.GetKey(KeyCode.F) || Input.GetKey(KeyCode.Mouse0) || Input.GetKey(KeyCode.Return); ui.jump = Input.GetKey(KeyCode.Space); ui.sprint = Input.GetKey(KeyCode.LeftShift); ui.menu = Input.GetKey(KeyCode.Tab); currentVehicle.VehicleFixedUpdate(ref ui, playerTransform, cameraTransform); }
// Apply physics forces public void FixedUpdate() { var moveVector = new Vector3(); foreach (var key in _movementControls.Keys) { if (Input.GetKey(key)) { moveVector += _movementControls[key]; } } ui.move = moveVector; ui.action = Input.GetKey(KeyCode.F) || Input.GetKey(KeyCode.Mouse0) || Input.GetKey(KeyCode.Return); ui.jump = Input.GetKey(KeyCode.Space); ui.sprint = Input.GetKey(KeyCode.LeftShift); ui.menu = Input.GetKey(KeyCode.Tab); currentVehicle.VehicleFixedUpdate(ref ui, playerTransform, cameraTransform); }