memo 12 C++ 배터리 콜렉터 03
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Pickup.generated.h"
UCLASS()
class TUTORIAL_BATTERYCOLL_API APickup : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
APickup();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
/** Retourn the mesh for the pickup */
FORCEINLINE class UStaticMeshComponent* GetMehs() const { return PickupMesh; }
private:
/** Static mehs to represent the puckup in ther level */
UPROPERTY(VisibleAnyWhere,BlueprintReadOnly,Category="Pickup",meta=(AllowPrivateAccess="true"))
UStaticMeshComponent * PickupMesh;
};
Generated Header
UCLASS 매크로
Tick 함수
// Sets default values
APickup::APickup()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
UPROPERTY(VisibleAnyWhere,BlueprintReadOnly,Category="Pickup",meta=(AllowPrivateAccess="true"))
UStaticMeshComponent * PickupMesh;
FORCEINLINE class UStaticMeshComponent* GetMehs() const { return PickupMesh; }
#include "Components/StaticMeshComponent.h" ( fixed error line )
#include "Pickup.h"
// Sets default values
APickup::APickup()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
PickupMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("PickupMesh"));
RootComponent = PickupMesh; ( fixed errorline )
}
'DailyUnreal' 카테고리의 다른 글
memo 14 C++ 배터리 콜렉터 05 , 6 , 7 , 8 , 9 , 10 (0) | 2018.08.17 |
---|---|
memo 13 C++ 배터리 콜렉터 04 (0) | 2018.08.17 |
memo 11 C++ 배터리 콜렉터 02 (0) | 2018.08.17 |
memo 10 - BluePrint 네트워크 이해 04 - 네트워크 연관성 (0) | 2018.07.27 |
memo 9 - BluePrint 네트워크 이해 03 - 함수 리플리케이션 (0) | 2018.07.27 |