아래의 코드에서 TFieldIterator나 UProperty을 사용하기 위해서는 위에 정의된 헤더 파일들을 기억하자.
#include "UObject/UnrealType.h"
#include "UObject/UnrealTypePrivate.h"
void AccessVariableNames()
{
FMyStructure MyStructureInstance;
const UStruct* Struct = MyStructureInstance.StaticStruct();
for (TFieldIterator<UProperty> PropIt(Struct); PropIt; ++PropIt)
{
UProperty* Property = *PropIt;
FString PropertyName = Property->GetName();
FString PropertyNameCPP = Property->GetNameCPP();
UE_LOG(LogTemp, Warning, TEXT("Property Name: %s (CPP: %s)"), *PropertyName, *PropertyNameCPP);
}
}
'Unreal' 카테고리의 다른 글
Unreal 메모리 관리 (0) | 2023.08.17 |
---|---|
에픽런쳐의 언리얼5.1와 GitHub에서 받아 빌드한 언리얼5.1 버전의 DDC 폴더 설정 (0) | 2023.08.16 |
언리얼에서의 메모리 할당 (0) | 2023.08.14 |
언리얼 엔진 빌드 환경 (0) | 2023.08.11 |
Unreal 5.1.1 엔진 소스 Setup.bat 오류 해결 방법 (0) | 2023.08.10 |