[UE5] UEnum 을 Foreach 로 사용하는 방법

Eu4ng·2024년 2월 7일

UE5 / TIL

목록 보기
7/8

방법

UENUM()
enum class EHealthAttributeType : uint8
{
  Health,
  MaxHealth,
  HealthRegenRate,
  Shield,
  MaxShield,

  Max
};
ENUM_RANGE_BY_COUNT(EHealthAttributeType, EHealthAttributeType::Max)

...

for(EHealthAttributeType AttributeType : TEnumRange<EHealthAttributeType>())
{
  // 작업
}

위 예제의 경우 EHealthAttributeType::Max 는 for 문에 포함되지 않습니다.

참고

profile
게임 클라이언트 프로그래머 취준생

0개의 댓글