반응형
UPROPERTY() - 에디터나 블루프린터상에 변수를 노출시키고 싶을 때 사용한다.
UFUNCTION() - 블루프린터에서 함수를 불러올 수 있게 한다.
UCLASS(Blueprintable) - 클래스 액터를 참조하는 블루프린트를 만드는 것을 가능하게 해준다.
ex)
// 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(Blueprintable)
class MINIMAL_DEFAULT_API UMyObject : public UObject
{
GENERATED_BODY()
public:
UMyObject();
UPROPERTY(BlueprintReadOnly , Category = "MyVariables") // reflection system 에 노출시킨다.
float MyFloat;
UFUNCTION(BlueprintCallable, Category = "MyFunctions") // 블루 프린트에서 더 쉽게 찾을 수 있다.
void MyFunction();
};
UCLASS(Blueprintable) 를 사용해서 블루프린트로 만드는 것을 가능하게 해 준다.
UPROPERTY(BlueprintReadOnly , Category = "MyVariables")
블루 프린트에서 읽기만 가능한 변수 라는 것을 알려주고 다음에 카테고리를 사용해서 찾을 수 있다.
UFUNCTION(BlueprintCallable, Category = "MyFunctions")
위와 같은 역할을 한다.
UPROPERTY() 에는 더욱 다양한 조건을 줄 수 있다.
UPROPERTY(VisibleAnywhere, Category = "ActorMeshComponents")
UStaticMeshComponent* StaticMesh;
// Location used by SetActorLocation() when beginPlay() is called
UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Category = "FloaterVectors")
FVector InitialLocation;
// Location of the Actor when dragged in fromm the editor
UPROPERTY(VisibleInstanceOnly,BlueprintReadWrite, Category = "FloaterVectors")
FVector PlacedLocation;
UPROPERTY(EditDefaultsOnly,BlueprintReadWrite, Category = "Floater Variables")
bool bInitializeFloaterLocations;
VisibleAnywhere - 에디터와 블루 프린트 모두 볼수있다.
EditInstanceOnly - 프로퍼티 창에서 편집할 수 있다.
VisibleInstanceOnly - 프로퍼티 창에서 편집 불가.
EditDefaultsOnly - 프로퍼티 창에서 편집이 가능합니다.
반응형
'Unreal' 카테고리의 다른 글
언리얼 Mobility 특성 (0) | 2023.03.05 |
---|---|
언리얼 - 블루프린트 사용 (출력하기, 조건문) (0) | 2023.03.05 |
[Unreal 4] 오브젝트 충돌 감지 - C++ (0) | 2023.01.15 |
[Unreal] 캐릭터 이동 및 마우스로 화면 전환 (1) - C++ (Character Class) (0) | 2023.01.04 |
언리얼 엔진(Unreal Engine) 오브젝트 움직이기 C++ (2) | 2023.01.01 |