언리얼 중첩 컨테이너 사용하기

Woogle·2023년 12월 22일
0

언리얼 엔진 5

목록 보기
50/59

📄 Nested containers are not supported

  • 언리얼은 중첩 컨테이너(Nested container)를 지원하지 않는다.

  • 즉, TArray가 TArray를 감싸는 것, TMap의 값에 TArray를 넣는 것 등이 불가능하다.

  • 이럴 때 구조체를 선언해서 감싸주면 해결된다.


✏️ 샘플 코드

USTRUCT()
struct FCollectedWeaponID
{
	GENERATED_BODY()

public:
	UPROPERTY()
	TArray<int32> WeaponIDs;
};

UPROPERTY(EditAnywhere, Category = "Inventory")
TMap<EWeaponCategory, FCollectedWeaponID> InventoryMap;
profile
노력하는 게임 개발자

0개의 댓글