57 lines
1.3 KiB
C++
57 lines
1.3 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Camera/CameraComponent.h"
|
|
#include "GameFramework/Character.h"
|
|
#include "TankPlayerCharacter.generated.h"
|
|
|
|
class UInputMappingContext;
|
|
class UInputAction;
|
|
|
|
UCLASS()
|
|
class TANK_API ATankPlayerCharacter : public ACharacter
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
|
|
public:
|
|
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
|
TSoftObjectPtr<UInputMappingContext> InputMappingContext;
|
|
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
|
UInputAction* MovementAction;
|
|
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
|
UInputAction* YawAction;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
UCameraComponent* CameraComponent;
|
|
|
|
public:
|
|
// Sets default values for this character's properties
|
|
ATankPlayerCharacter();
|
|
|
|
protected:
|
|
// Called when the game starts or when spawned
|
|
virtual void BeginPlay() override;
|
|
|
|
public:
|
|
// Called every frame
|
|
virtual void Tick(float DeltaTime) override;
|
|
|
|
// Called to bind functionality to input
|
|
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
|
|
|
private:
|
|
|
|
UFUNCTION()
|
|
void MovementCallback(const FInputActionInstance& Instance);
|
|
|
|
UFUNCTION()
|
|
void RotationCallback(const FInputActionInstance& Instance);
|
|
|
|
};
|