在c++脚本中添加轴映射,操作映射。不是绑定映射
UPlayerInput::AddEngineDefinedActionMapping(FInputActionKeyMapping("SpeedUp",EKeys::LeftShift)); //添加ActionMapping动作映射
PlayerInputComponent->BindAction("SpeedUp", IE_Pressed,this,&APawnWithCamera::SpeedUpIn);
PlayerInputComponent->BindAction("SpeedUp", IE_Released,this,&APawnWithCamera::SpeedUpOut); //绑定ActionMapping动作映射
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("Turn", EKeys::MouseX, 1.0f)); //添加AxisMapping轴映射
PlayerInputComponent->BindAxis("Turn", this, &ACameraCharacter::OnTurn); //绑定AxisMapping轴映射