Skip to content
Snippets Groups Projects
Commit 4ecfebe3 authored by Kris Tabea Helwig's avatar Kris Tabea Helwig
Browse files

Feature(pawn, movement): Exposed PlayerInputComponent; Exposed SetupPlayerInput to BPs.

parent d7db3d0a
No related branches found
No related tags found
3 merge requests!80UE5.3-2023.1-rc2,!78Feature(pawn, movement): Exposed PlayerInputComponent, Exposed SetupPlayerInput to BPs.,!77ContentExample-themed ToolkitExamples map.
Pipeline #349039 failed
...@@ -93,6 +93,8 @@ void ARWTHVRPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponen ...@@ -93,6 +93,8 @@ void ARWTHVRPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponen
{ {
Super::SetupPlayerInputComponent(PlayerInputComponent); Super::SetupPlayerInputComponent(PlayerInputComponent);
ThisPlayerInputComponent = PlayerInputComponent;
APlayerController* PlayerController = Cast<APlayerController>(GetController()); APlayerController* PlayerController = Cast<APlayerController>(GetController());
if (!PlayerController) if (!PlayerController)
{ {
...@@ -145,6 +147,12 @@ void ARWTHVRPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponen ...@@ -145,6 +147,12 @@ void ARWTHVRPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponen
} }
} }
UInputComponent* ARWTHVRPawn::GetPlayerInputComponent()
{
return ThisPlayerInputComponent;
}
void ARWTHVRPawn::AddInputMappingContext(const APlayerController* PC, const UInputMappingContext* Context) const void ARWTHVRPawn::AddInputMappingContext(const APlayerController* PC, const UInputMappingContext* Context) const
{ {
if (Context) if (Context)
......
...@@ -19,6 +19,7 @@ class RWTHVRTOOLKIT_API UMovementComponentBase : public UActorComponent, public ...@@ -19,6 +19,7 @@ class RWTHVRTOOLKIT_API UMovementComponentBase : public UActorComponent, public
public: public:
// Already sets up VRPawn and InputSubsystem properties that can be used by child classes. // Already sets up VRPawn and InputSubsystem properties that can be used by child classes.
UFUNCTION(BlueprintCallable)
virtual void SetupPlayerInput(UInputComponent* PlayerInputComponent) override; virtual void SetupPlayerInput(UInputComponent* PlayerInputComponent) override;
protected: protected:
......
...@@ -87,6 +87,9 @@ protected: ...@@ -87,6 +87,9 @@ protected:
virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override; virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override;
void AddInputMappingContext(const APlayerController* PC, const UInputMappingContext* Context) const; void AddInputMappingContext(const APlayerController* PC, const UInputMappingContext* Context) const;
UFUNCTION(BlueprintCallable)
UInputComponent* GetPlayerInputComponent();
/* LiveLink helper function called on tick */ /* LiveLink helper function called on tick */
void EvaluateLivelink() const; void EvaluateLivelink() const;
...@@ -109,4 +112,8 @@ protected: ...@@ -109,4 +112,8 @@ protected:
/* Set device specific motion controller sources (None, L/R, Livelink) */ /* Set device specific motion controller sources (None, L/R, Livelink) */
void SetupMotionControllerSources(); void SetupMotionControllerSources();
private:
UInputComponent* ThisPlayerInputComponent;
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment