하위 C++ 클래스 생성하기
This commit is contained in:
parent
06b88f04d3
commit
8e95e46b97
BIN
Content/Blueprints/Pawns/BP_PawnTank.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Pawns/BP_PawnTank.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Maps/Main.umap
(Stored with Git LFS)
BIN
Content/Maps/Main.umap
(Stored with Git LFS)
Binary file not shown.
16
Source/ToonTanks/Tank.cpp
Normal file
16
Source/ToonTanks/Tank.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "Tank.h"
|
||||
|
||||
#include "Camera/CameraComponent.h"
|
||||
#include "GameFramework/SpringArmComponent.h"
|
||||
|
||||
ATank::ATank()
|
||||
{
|
||||
SpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("SpringArm"));
|
||||
SpringArm->SetupAttachment(RootComponent);
|
||||
|
||||
Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
|
||||
Camera->SetupAttachment(SpringArm);
|
||||
}
|
27
Source/ToonTanks/Tank.h
Normal file
27
Source/ToonTanks/Tank.h
Normal file
@ -0,0 +1,27 @@
|
||||
// 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();
|
||||
|
||||
private:
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Component", meta=(AllowPrivateAccess = "true"))
|
||||
class USpringArmComponent* SpringArm;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Component", meta=(AllowPrivateAccess = "true"))
|
||||
class UCameraComponent* Camera;
|
||||
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user