캐스팅
This commit is contained in:
parent
1aebda717b
commit
8e1f1c0e2a
@ -24,13 +24,6 @@ ABasePawn::ABasePawn()
|
|||||||
ProjectileSpawnPoint->SetupAttachment(TurretMesh);
|
ProjectileSpawnPoint->SetupAttachment(TurretMesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when the game starts or when spawned
|
|
||||||
void ABasePawn::BeginPlay()
|
|
||||||
{
|
|
||||||
Super::BeginPlay();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called every frame
|
// Called every frame
|
||||||
void ABasePawn::Tick(float DeltaTime)
|
void ABasePawn::Tick(float DeltaTime)
|
||||||
{
|
{
|
||||||
|
@ -15,10 +15,6 @@ public:
|
|||||||
// Sets default values for this pawn's properties
|
// Sets default values for this pawn's properties
|
||||||
ABasePawn();
|
ABasePawn();
|
||||||
|
|
||||||
protected:
|
|
||||||
// Called when the game starts or when spawned
|
|
||||||
virtual void BeginPlay() override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Component", meta=(AllowPrivateAccess = "true"))
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Component", meta=(AllowPrivateAccess = "true"))
|
||||||
class UCapsuleComponent* CapsuleComp;
|
class UCapsuleComponent* CapsuleComp;
|
||||||
|
@ -23,6 +23,14 @@ void ATank::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
|
|||||||
PlayerInputComponent->BindAxis(TEXT("Turn"), this, &ATank::Turn);
|
PlayerInputComponent->BindAxis(TEXT("Turn"), this, &ATank::Turn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Called when the game starts or when spawned
|
||||||
|
void ATank::BeginPlay()
|
||||||
|
{
|
||||||
|
Super::BeginPlay();
|
||||||
|
|
||||||
|
PlayerControllerRef = Cast<APlayerController>(GetController());
|
||||||
|
}
|
||||||
|
|
||||||
void ATank::Move(float Value)
|
void ATank::Move(float Value)
|
||||||
{
|
{
|
||||||
FVector DeltaLocation = FVector::ZeroVector;
|
FVector DeltaLocation = FVector::ZeroVector;
|
||||||
|
@ -19,6 +19,10 @@ public:
|
|||||||
|
|
||||||
// Called to bind functionality to input
|
// Called to bind functionality to input
|
||||||
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Called when the game starts or when spawned
|
||||||
|
virtual void BeginPlay() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Component", meta=(AllowPrivateAccess = "true"))
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Component", meta=(AllowPrivateAccess = "true"))
|
||||||
@ -32,6 +36,8 @@ private:
|
|||||||
|
|
||||||
UPROPERTY(EditAnywhere, Category = "Movement")
|
UPROPERTY(EditAnywhere, Category = "Movement")
|
||||||
float TurnRate = 45.0f;
|
float TurnRate = 45.0f;
|
||||||
|
|
||||||
|
APlayerController* PlayerControllerRef;
|
||||||
|
|
||||||
void Move(float Value);
|
void Move(float Value);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user