44 lines
1.2 KiB
C++
44 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "GameFramework/Pawn.h"
|
|
#include "SpaceshipPawn.generated.h"
|
|
|
|
UCLASS()
|
|
class MYPROJECT3_API ASpaceshipPawn : public APawn
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
ASpaceshipPawn();
|
|
virtual void Tick(float DeltaTime) override;
|
|
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
|
|
|
protected:
|
|
virtual void BeginPlay() override;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
|
|
class UStaticMeshComponent* ShipMesh;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
|
|
class USpringArmComponent* CameraSpringArm;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
|
|
class UCameraComponent* Camera;
|
|
|
|
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();
|
|
|
|
private:
|
|
FVector CurrentVelocity;
|
|
}; |