updateState method

  1. @override
void updateState(
  1. GamepadState state
)
override

Any logic to run before checking parseInputs.

Implementation

@override
void updateState(GamepadState state) {
  if (!leftShoulderFlag && state.leftShoulder) throttle -= 0.1;
  leftShoulderFlag = state.leftShoulder;
  if (!rightShoulderFlag && state.rightShoulder) throttle += 0.1;
  rightShoulderFlag = state.rightShoulder;
  throttle = throttle.clamp(0, 1);
}