// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "MyObject.generated.h"
/**
*
*/
UCLASS()
class FIRSTPROJECT_API UMyObject : public UObject
{
GENERATED_BODY()
public:
UMyObject();
private:
float MyFloat;
void MyFunction();
};
// Fill out your copyright notice in the Description page of Project Settings.
#include "MyObject.h"
UMyObject::UMyObject()
{
MyFloat = 0.f;
}
void UMyObject::MyFunction()
{
}
만약 C++ Object에 BluePrint를 쓰고싶다면??
UCLASS(Blueprintable)
class FIRSTPROJECT_API UMyObject : public UObject
{
GENERATED_BODY()
public:
UMyObject();
// ...
Blueprint를 사용할수 있음을 확인할 수 있다.
실제로 Blueprint를 사용해보자면
이제 Blueprint에서 C++ Object의 변수에 접근해보자.
UCLASS(Blueprintable)
class FIRSTPROJECT_API UMyObject : public UObject
{
GENERATED_BODY()
public:
UMyObject();
public:
UPROPERTY(BlueprintReadWrite)
float MyFloat;
UFUNCTION(BlueprintCallable)
void MyFunction();
};