Compare commits

...

2 Commits

Author SHA1 Message Date
Ji Yoon Rhee
1b515981f5 created input mapping context for projectile attacks and UI toggling 2024-06-08 23:27:33 +09:00
Ji Yoon Rhee
d51ec24938 set up input mapping in hwanyoung2 character 2024-06-08 23:26:38 +09:00
19 changed files with 43 additions and 22 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -44,6 +44,10 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 InventoryWeightLimit;
/** MappingContext */
UPROPERTY(EditAnywhere, Category = Input, meta = (AllowPrivateAccess = "true"))
class UInputMappingContext* InputMapping;
/** Toggle inventory GUI Input Action */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
class UInputAction* ToggleInventoryAction;

View File

@ -50,9 +50,11 @@ void Ahwanyoung2Character::BeginPlay()
{
if (UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(PlayerController->GetLocalPlayer()))
{
Subsystem->AddMappingContext(DefaultMappingContext, 0);
Subsystem->AddMappingContext(InputMapping, 0);
}
}
}
void Ahwanyoung2Character::CheckForInteractables()

View File

@ -4,7 +4,7 @@
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "InputActionValue.h"
#include "InputAction.h"
#include "hwanyoung2.h"
#include "hwanyoung2Character.generated.h"
@ -28,8 +28,8 @@ class Ahwanyoung2Character : public ACharacter
#pragma region Character Gameplay Input Action
/** MappingContext */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
class UInputMappingContext* DefaultMappingContext;
UPROPERTY(EditAnywhere, Category = Input, meta = (AllowPrivateAccess = "true"))
class UInputMappingContext* InputMapping;
/** Jump Input Action */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))