Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
d3fe65f25a
BIN
Content/Legumix/Player/BP_Play.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Player/BP_Play.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Legumix/Player/BP_PlayerController.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Player/BP_PlayerController.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Legumix/Player/HUD/WP_PauseMenu.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Legumix/Player/HUD/WP_PauseMenu.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Legumix/Player/Input/IA_Pause.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Legumix/Player/Input/IA_Pause.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Legumix/Player/Input/IMC_Default.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Player/Input/IMC_Default.uasset
(Stored with Git LFS)
Binary file not shown.
@ -135,6 +135,10 @@ FVector ALMPlayer::GetWeaponFiringOrigin()
|
||||
|
||||
FVector ALMPlayer::GetAimVector() { return GetCam()->GetForwardVector(); }
|
||||
|
||||
void ALMPlayer::OnPause_Implementation(bool Paused)
|
||||
{
|
||||
}
|
||||
|
||||
UCameraComponent* ALMPlayer::GetCam()
|
||||
{
|
||||
if (!Camera)
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "EnhancedInputComponent.h"
|
||||
#include "LMUserSettings.h"
|
||||
#include "GameFramework/Character.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
#include "Player/LMPlayer.h"
|
||||
#include "Weapon/LMWeaponManager.h"
|
||||
|
||||
@ -28,6 +29,7 @@ void ALMPlayerController::SetupInputComponent()
|
||||
Input->BindAction(FireAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Fire);
|
||||
Input->BindAction(ReloadAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Reload);
|
||||
Input->BindAction(ScrollAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Scroll);
|
||||
Input->BindAction(PauseAction, ETriggerEvent::Triggered, this, &ALMPlayerController::PauseGame);
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,3 +70,12 @@ void ALMPlayerController::Scroll(const FInputActionValue& InputValue)
|
||||
const float ScrollAmount = InputValue.Get<float>();
|
||||
LegumixPlayer->GetWeaponManager()->SwitchWeapon(ScrollAmount);
|
||||
}
|
||||
|
||||
void ALMPlayerController::PauseGame(const FInputActionValue& InputValue)
|
||||
{
|
||||
const bool bIsPaused = UGameplayStatics::IsGamePaused(GetWorld());
|
||||
UGameplayStatics::SetGamePaused(GetWorld(), !bIsPaused);
|
||||
SetShowMouseCursor(!bIsPaused);
|
||||
|
||||
LegumixPlayer->OnPause(!bIsPaused);
|
||||
}
|
||||
|
@ -83,6 +83,9 @@ public:
|
||||
UFUNCTION(BlueprintImplementableEvent, Category=Legumix)
|
||||
void OnReload();
|
||||
|
||||
UFUNCTION(BlueprintNativeEvent, BlueprintCallable)
|
||||
void OnPause(bool Paused);
|
||||
|
||||
public:
|
||||
UFUNCTION(BlueprintImplementableEvent)
|
||||
UCameraComponent* GetCamera();
|
||||
|
@ -45,6 +45,9 @@ private:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = true))
|
||||
TObjectPtr<UInputAction> ScrollAction;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = true))
|
||||
TObjectPtr<UInputAction> PauseAction;
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, meta = (AllowPrivateAccess = true))
|
||||
TObjectPtr<ALMPlayer> LegumixPlayer;
|
||||
|
||||
@ -55,4 +58,5 @@ private:
|
||||
void Fire(const FInputActionValue& InputValue);
|
||||
void Reload(const FInputActionValue& InputValue);
|
||||
void Scroll(const FInputActionValue& InputValue);
|
||||
void PauseGame(const FInputActionValue& InputValue);
|
||||
};
|
||||
|
Reference in New Issue
Block a user