From 65fc5bdf9709497afe15a206362224afc15e6649 Mon Sep 17 00:00:00 2001 From: 10000Je Date: Sun, 13 Apr 2025 22:35:58 +0900 Subject: [PATCH] remove .vsconfig --- .gitignore | 1 + Content/Blueprints/Pawns/BP_PawnTank.uasset | 3 +++ Content/Blueprints/Pawns/BP_PawnTurret.uasset | 3 +++ Source/ToonTanks/BasePawn.cpp | 15 ++++++++++++++- Source/ToonTanks/BasePawn.h | 13 +++++++++++++ 5 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 Content/Blueprints/Pawns/BP_PawnTank.uasset create mode 100644 Content/Blueprints/Pawns/BP_PawnTurret.uasset diff --git a/.gitignore b/.gitignore index eca6ca1..a4dad53 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ Saved .idea .vscode .vs +*.vsconfig *.VC.db *.opensdf *.opendb diff --git a/Content/Blueprints/Pawns/BP_PawnTank.uasset b/Content/Blueprints/Pawns/BP_PawnTank.uasset new file mode 100644 index 0000000..df7c170 --- /dev/null +++ b/Content/Blueprints/Pawns/BP_PawnTank.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:55e4c23db91a63ff99ed9ba15d6c205e18773f201a8cdc3fb56540897577f880 +size 23137 diff --git a/Content/Blueprints/Pawns/BP_PawnTurret.uasset b/Content/Blueprints/Pawns/BP_PawnTurret.uasset new file mode 100644 index 0000000..a1859dc --- /dev/null +++ b/Content/Blueprints/Pawns/BP_PawnTurret.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dff4d53b5b2d3ef4c0c29f3e05a6fdda446e19f2648c80bbf8a77b831a1420c8 +size 23175 diff --git a/Source/ToonTanks/BasePawn.cpp b/Source/ToonTanks/BasePawn.cpp index f267e44..b2f505d 100644 --- a/Source/ToonTanks/BasePawn.cpp +++ b/Source/ToonTanks/BasePawn.cpp @@ -3,19 +3,32 @@ #include "BasePawn.h" +#include "Components/CapsuleComponent.h" + // Sets default values ABasePawn::ABasePawn() { // Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it. PrimaryActorTick.bCanEverTick = true; + + CapsuleComp = CreateDefaultSubobject(TEXT("Capsule Collider")); + RootComponent = CapsuleComp; + BaseMesh = CreateDefaultSubobject(TEXT("Base Mesh")); + BaseMesh->SetupAttachment(RootComponent); + + TurretMesh = CreateDefaultSubobject(TEXT("Turret Mesh")); + TurretMesh->SetupAttachment(BaseMesh); + + ProjectileSpawnPoint = CreateDefaultSubobject(TEXT("Projectile Spawn Point")); + ProjectileSpawnPoint->SetupAttachment(TurretMesh); } // Called when the game starts or when spawned void ABasePawn::BeginPlay() { Super::BeginPlay(); - + } // Called every frame diff --git a/Source/ToonTanks/BasePawn.h b/Source/ToonTanks/BasePawn.h index bf18077..15ca6a7 100644 --- a/Source/ToonTanks/BasePawn.h +++ b/Source/ToonTanks/BasePawn.h @@ -19,6 +19,19 @@ protected: // Called when the game starts or when spawned virtual void BeginPlay() override; +private: + UPROPERTY() + class UCapsuleComponent* CapsuleComp; + + UPROPERTY() + UStaticMeshComponent* BaseMesh; + + UPROPERTY() + UStaticMeshComponent* TurretMesh; + + UPROPERTY() + USceneComponent* ProjectileSpawnPoint; + public: // Called every frame virtual void Tick(float DeltaTime) override;