Modify to use EnhancedInput
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/Pawn.h"
|
||||
#include "InputActionValue.h"
|
||||
#include "SpaceshipPawn.generated.h"
|
||||
|
||||
UCLASS()
|
||||
@@ -26,18 +27,29 @@ protected:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
|
||||
class UCameraComponent* Camera;
|
||||
|
||||
// Enhanced Input Components
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Input")
|
||||
class UInputMappingContext* DefaultMappingContext;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Input")
|
||||
class UInputAction* MovementAction;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Input")
|
||||
class UInputAction* LookAction;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Input")
|
||||
class UInputAction* FireAction;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Movement")
|
||||
float MovementSpeed = 1000.0f;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Movement")
|
||||
float RotationSpeed = 100.0f;
|
||||
|
||||
// Movement functions
|
||||
void MoveForward(float Value);
|
||||
void MoveRight(float Value);
|
||||
void Turn(float Value);
|
||||
void LookUp(float Value);
|
||||
void Fire();
|
||||
// Input functions
|
||||
void Move(const FInputActionValue& Value);
|
||||
void Look(const FInputActionValue& Value);
|
||||
void Fire(const FInputActionValue& Value);
|
||||
|
||||
private:
|
||||
FVector CurrentVelocity;
|
||||
|
||||
Reference in New Issue
Block a user