728x90

언리얼에서 TFieldIterator을 사용하여 리플렉션으로 속성과 함수들의 검색이 가능하다.

멤버 변수에는 UPROPERTY, 멤버 함수에는 UFUNCTION 매크로를 지정해주어야 가능하다.

 

TFieldIterator<UProperty>타입을 사용하면 속성을 가져올수 있다.

for (TFieldIterator<UProperty> It(ClassInfo1); It; ++It)
{
    AB_LOG(Warning, TEXT("Field : %s, Type : %s"), *It->GetName(), *It->GetClass()->GetName());
    UStrProperty* StrProp = FindField<UStrProperty>(ClassInfo1, *It->GetName());
    if (StrProp)
    {
       AB_LOG(Warning, TEXT("Value = %s"), *StrProp->GetPropertyValue_InContainer(WebConnection));
    }
 }

 

TFieldIterator< UFunction >타입을 사용하면 함수을 가져올수 있다.

for ( TFieldIterator<UFunction> FunctionIterator( MyObjectsClass ); FunctionIterator; ++FunctionIterator )
{
    UFunction* Func = *FunctionIterator;
    
    UE_LOG( LogTemp, Log, TEXT( "%s" ), *FunctionIterator->GetName() ); 
}

 

함수의 경우 NativeFunctionLookupTable 배열을 사용해 현재 클래스에 어떤 함수가 있는지 알수 있다.

함수의 이름을 사용하여 FindFunctionByName함수를 사용해 가져올수 있다.

for (const auto& Entry : ClassInfo1->NativeFunctionLookupTable)
{
    AB_LOG(Warning, TEXT("Function=%s"), *Entry.Name.ToString());
 
    UFunction* Func1 = ClassInfo1->FindFunctionByName(Entry.Name);
    if (Func1->ParmsSize == 0)
    {
        WebConnection->ProcessEvent(Func1, NULL);
    }
}

 

728x90
Posted by 정망스
,
728x90

-게임 인스턴스 (컨텐츠에 관여하는 용도로 사용하기보다, 어플리케이션의 데이터를 관리하는 용도로 많이 사용)

-에셋 매니저

-게임 플레이 관련 액터 (게임모드, 게임 스테이트)

-프로젝트에 싱글톤으로 등록한 언리얼 오브젝트

728x90
Posted by 정망스
,

포트폴리오 동영상

기타 2024. 2. 13. 11:30
728x90

 

[Unreal] 공부용 프로토게임

 

[Unity] 크루세이더 퀘스트

 

[Unity] 허슬(가칭)

 

[Unity] WarChess

 

[Unity] OH MY CRYSTAL

 

[Unreal] 공부용 프로토게임

 

[Cocos2d] PushTrash

 

[Cocos2d] NumberPush

 

[Unity] Number Ping-Pong

 

[Android] KSU
728x90
Posted by 정망스
,


맨 위로
홈으로 ▲위로 ▼아래로 ♥댓글쓰기 새로고침