Pawn added
This commit is contained in:
BIN
Content/Blueprints/Pawns/BP_PawnTank.uasset
Normal file
BIN
Content/Blueprints/Pawns/BP_PawnTank.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprints/Pawns/BP_PawnTurret.uasset
Normal file
BIN
Content/Blueprints/Pawns/BP_PawnTurret.uasset
Normal file
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,7 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
#include "Components/CapsuleComponent.h"
|
||||||
#include "BasePawn.h"
|
#include "BasePawn.h"
|
||||||
|
|
||||||
// Sets default values
|
// Sets default values
|
||||||
@@ -9,6 +10,18 @@ ABasePawn::ABasePawn()
|
|||||||
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it.
|
// 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;
|
PrimaryActorTick.bCanEverTick = true;
|
||||||
|
|
||||||
|
CapsuleComp = CreateDefaultSubobject<UCapsuleComponent>(TEXT("Capsule Collider"));
|
||||||
|
RootComponent = CapsuleComp;
|
||||||
|
|
||||||
|
BaseMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Base Mesh"));
|
||||||
|
BaseMesh->SetupAttachment(CapsuleComp);
|
||||||
|
|
||||||
|
TurretMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Turret Mesh"));
|
||||||
|
TurretMesh->SetupAttachment(BaseMesh);
|
||||||
|
|
||||||
|
ProjectileSpawnPoint = CreateDefaultSubobject<USceneComponent>(TEXT("Spawn Point"));
|
||||||
|
ProjectileSpawnPoint->SetupAttachment(TurretMesh);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when the game starts or when spawned
|
// Called when the game starts or when spawned
|
||||||
|
|||||||
@@ -14,15 +14,49 @@ class TOONTANKS_API ABasePawn : public APawn
|
|||||||
public:
|
public:
|
||||||
// Sets default values for this pawn's properties
|
// Sets default values for this pawn's properties
|
||||||
ABasePawn();
|
ABasePawn();
|
||||||
|
|
||||||
|
//test uprops
|
||||||
|
UPROPERTY(VisibleInstanceOnly)
|
||||||
|
int32 VisibleIstanceOnlyInt = 11;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadOnly)
|
||||||
|
int32 EditAnywhereInt = 22;
|
||||||
|
|
||||||
|
UPROPERTY(VisibleDefaultsOnly)
|
||||||
|
int32 VisibleDefaultOnlyInt = 5;
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly)
|
||||||
|
int32 EditDefaultsOnlyInt = 9;
|
||||||
|
|
||||||
|
UPROPERTY(EditInstanceOnly)
|
||||||
|
int32 EditInstanceOnlyInt = 14;
|
||||||
|
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UPROPERTY()
|
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components", meta = (AllowPrivateAccess = "true"))
|
||||||
class UCapsuleComponent* CapsuleComp;
|
class UCapsuleComponent* CapsuleComp;
|
||||||
|
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components", meta = (AllowPrivateAccess = "true"))
|
||||||
|
UStaticMeshComponent* BaseMesh;
|
||||||
|
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components", meta = (AllowPrivateAccess = "true"))
|
||||||
|
UStaticMeshComponent* TurretMesh;
|
||||||
|
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components", meta = (AllowPrivateAccess = "true"))
|
||||||
|
USceneComponent* ProjectileSpawnPoint;
|
||||||
|
|
||||||
|
//test uprops showing all that you can do with them
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Super Duper Variables", meta = (AllowPrivateAccess = "true"))
|
||||||
|
float Speed = 400.f;
|
||||||
|
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Super Duper Variables", meta = (AllowPrivateAccess = "true"))
|
||||||
|
int32 VisibleAnywhere = 12;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Called every frame
|
// Called every frame
|
||||||
virtual void Tick(float DeltaTime) override;
|
virtual void Tick(float DeltaTime) override;
|
||||||
|
|||||||
Reference in New Issue
Block a user