protected override void OnUpdate() { Entities.With(inputPlayerGroup).ForEach((ref CameraTransform cameraTransform, ref AdvancedPlayerInput.Component playerInput, ref SpatialEntityId entityId) => { var forward = Vector3.forward; var right = Vector3.right; var input = InputUtils.GetMove(right, forward); var isShiftDown = Input.GetKey(KeyCode.LeftShift); var controller = playerInput.LocalController; CommonUpdate(input, isShiftDown, entityId, ref controller); playerInput.LocalController = controller; }); }
private void Query(ref CameraTransform cameraTransform, ref AdvancedUnitController.Component unitController, ref LocalController local) { var input = InputUtils.GetMove(); var inputCam = InputUtils.GetCamera(); var isShiftDown = Input.GetKey(KeyCode.LeftShift); var isJump = Input.GetKey(KeyCode.Space); var action = local.Action; var stick = local.Stick; if (CommonUpdate(input, inputCam, isShiftDown, isJump, false, false, ref stick, ref action)) { unitController.Action = action; } local.Stick = stick; local.Action = action; }