Add Pause Player Input Action
This commit is contained in:
parent
12db67439f
commit
322b872042
BIN
Content/Input/Actions/IA_Look.uasset (Stored with Git LFS)
BIN
Content/Input/Actions/IA_Look.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/Input/InputMappingContext.uasset (Stored with Git LFS)
BIN
Content/Input/InputMappingContext.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/Player/PlayerCharacter.uasset (Stored with Git LFS)
BIN
Content/Player/PlayerCharacter.uasset (Stored with Git LFS)
Binary file not shown.
|
@ -182,6 +182,11 @@ void APlayerCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputCom
|
|||
Input->BindAction(ThrowExplosiveAction, ETriggerEvent::Started, this,
|
||||
&APlayerCharacter::ThrowExplosiveCallback);
|
||||
}
|
||||
|
||||
if (PauseAction)
|
||||
{
|
||||
Input->BindAction(PauseAction, ETriggerEvent::Completed, this, &APlayerCharacter::PauseCallback);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -482,6 +487,10 @@ void APlayerCharacter::EndAimDownSightsCallback(const FInputActionInstance& Inst
|
|||
true, EMoveComponentAction::Type::Move, LatentActionInfo);
|
||||
}
|
||||
|
||||
void APlayerCharacter::PauseCallback(const FInputActionInstance& Instance)
|
||||
{
|
||||
}
|
||||
|
||||
void APlayerCharacter::OnFire()
|
||||
{
|
||||
if (!IsFiring || CurrentWeapon->GetAmmoCount() == 0)
|
||||
|
|
|
@ -54,6 +54,15 @@ public:
|
|||
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||
UInputAction* ThrowExplosiveAction;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||
UInputAction* PauseAction;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||
UInputAction* WeaponSwitchingAction;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||
UInputAction* AimDownSightsAction;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||
TSoftObjectPtr<UInputMappingContext> InputMappingContext;
|
||||
|
@ -61,12 +70,6 @@ public:
|
|||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||
int MappingPriority = 0;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||
UInputAction* WeaponSwitchingAction;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||
UInputAction* AimDownSightsAction;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||
TSubclassOf<class UUserWidget> PlayerHUD;
|
||||
|
||||
|
@ -161,6 +164,8 @@ public:
|
|||
|
||||
void EndAimDownSightsCallback(const FInputActionInstance& Instance);
|
||||
|
||||
void PauseCallback(const FInputActionInstance& Instance);
|
||||
|
||||
virtual void OnFire() override;
|
||||
|
||||
void WeaponCooldownHandler();
|
||||
|
|
Loading…
Reference in New Issue