57 lines
1.4 KiB
C++
57 lines
1.4 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "BasePawn.h"
|
|
#include "Tank.generated.h"
|
|
|
|
/**
|
|
*
|
|
*/
|
|
UCLASS()
|
|
class TOONTANKS_API ATank : public ABasePawn
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
ATank();
|
|
|
|
// Called to bind functionality to input
|
|
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
|
|
|
// Called every frame
|
|
virtual void Tick(float DeltaTime) override;
|
|
|
|
protected:
|
|
// Called when the game starts or when spawned
|
|
virtual void BeginPlay() override;
|
|
|
|
private:
|
|
// USpringArmComponent for Camera
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Component", meta=(AllowPrivateAccess = "true"))
|
|
class USpringArmComponent* SpringArm;
|
|
|
|
// UCameraComponent for Camera Component
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Component", meta=(AllowPrivateAccess = "true"))
|
|
class UCameraComponent* Camera;
|
|
|
|
// Movement speed for Move() operation
|
|
UPROPERTY(EditAnywhere, Category = "Movement", BlueprintReadWrite, meta=(AllowPrivateAccess="true"))
|
|
float Speed = 400.0f;
|
|
|
|
// Turn speed for Turn() operation
|
|
UPROPERTY(EditAnywhere, Category = "Movement")
|
|
float TurnRate = 45.0f;
|
|
|
|
// PlayerController Pointer for Mouse Location Detection
|
|
UPROPERTY()
|
|
APlayerController* PlayerControllerRef;
|
|
|
|
// Move operation through W/S key
|
|
void Move(float Value);
|
|
|
|
// Turn operation through A/D key
|
|
void Turn(float Value);
|
|
};
|