마우스 커서 사용하기
This commit is contained in:
parent
8e1f1c0e2a
commit
580ca82639
File diff suppressed because one or more lines are too long
BIN
Content/Maps/Main.umap
(Stored with Git LFS)
BIN
Content/Maps/Main.umap
(Stored with Git LFS)
Binary file not shown.
@ -23,10 +23,3 @@ ABasePawn::ABasePawn()
|
|||||||
ProjectileSpawnPoint = CreateDefaultSubobject<USceneComponent>(TEXT("Projectile Spawn Point"));
|
ProjectileSpawnPoint = CreateDefaultSubobject<USceneComponent>(TEXT("Projectile Spawn Point"));
|
||||||
ProjectileSpawnPoint->SetupAttachment(TurretMesh);
|
ProjectileSpawnPoint->SetupAttachment(TurretMesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called every frame
|
|
||||||
void ABasePawn::Tick(float DeltaTime)
|
|
||||||
{
|
|
||||||
Super::Tick(DeltaTime);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -27,9 +27,5 @@ private:
|
|||||||
|
|
||||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Component", meta=(AllowPrivateAccess = "true"))
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Component", meta=(AllowPrivateAccess = "true"))
|
||||||
USceneComponent* ProjectileSpawnPoint;
|
USceneComponent* ProjectileSpawnPoint;
|
||||||
|
|
||||||
public:
|
|
||||||
// Called every frame
|
|
||||||
virtual void Tick(float DeltaTime) override;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -23,12 +23,42 @@ void ATank::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
|
|||||||
PlayerInputComponent->BindAxis(TEXT("Turn"), this, &ATank::Turn);
|
PlayerInputComponent->BindAxis(TEXT("Turn"), this, &ATank::Turn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Called every frame
|
||||||
|
void ATank::Tick(float DeltaTime)
|
||||||
|
{
|
||||||
|
Super::Tick(DeltaTime);
|
||||||
|
|
||||||
|
if (PlayerControllerRef)
|
||||||
|
{
|
||||||
|
FHitResult HitResult;
|
||||||
|
PlayerControllerRef->GetHitResultUnderCursor(
|
||||||
|
ECollisionChannel::ECC_Visibility,
|
||||||
|
false,
|
||||||
|
HitResult);
|
||||||
|
DrawDebugSphere(
|
||||||
|
GetWorld(),
|
||||||
|
HitResult.ImpactPoint,
|
||||||
|
25,
|
||||||
|
12,
|
||||||
|
FColor::Green);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Called when the game starts or when spawned
|
// Called when the game starts or when spawned
|
||||||
void ATank::BeginPlay()
|
void ATank::BeginPlay()
|
||||||
{
|
{
|
||||||
Super::BeginPlay();
|
Super::BeginPlay();
|
||||||
|
|
||||||
PlayerControllerRef = Cast<APlayerController>(GetController());
|
PlayerControllerRef = Cast<APlayerController>(GetController());
|
||||||
|
DrawDebugSphere(
|
||||||
|
GetWorld(),
|
||||||
|
GetActorLocation() + FVector(0, 0, 200),
|
||||||
|
100,
|
||||||
|
12,
|
||||||
|
FColor::Red,
|
||||||
|
false,
|
||||||
|
30);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ATank::Move(float Value)
|
void ATank::Move(float Value)
|
||||||
|
@ -20,6 +20,9 @@ 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;
|
||||||
|
|
||||||
|
// Called every frame
|
||||||
|
virtual void Tick(float DeltaTime) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Called when the game starts or when spawned
|
// Called when the game starts or when spawned
|
||||||
virtual void BeginPlay() override;
|
virtual void BeginPlay() override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user