[Unreal] 언리얼엔진 상속관계(=계층구조)

언리얼 엔진에서 클래스의 상속 관계는 매우 중요한 부분을 차지한다. 언리얼 엔진은 객체 지향 프로그래밍의 특징을 가지고 있기 때문에, 상속은 코드 재사용, 확장성 및 유지 관리를 신경써야 한다. 아래에 언리얼 엔진에서 일반적으로 사용되는 몇 가지 주요 클래스와 그들 사이의 기본적인 상속 관계에 대한 설명을 적었다.
목차
Unreal 상속관계
Unreal 상속관계와 특징 ("Is A" vs "Has A" 관계)
데이터 | level에 배치 | 시각적 실체 | Contorller에 의해 빙의 가능 |
Character movement component | Character 전용 기능 |
|
UObject | O | X | X | X | X | X |
AActor | O | O | O | X | X | X |
APawn | O | O | O | O | X | X |
ACharacter | O | O | O | O | O | O |
a UObject is not an AActor
a UObject is not an APawn
an AActor is a UObject
an AActor is not an APawn
an APawn is an AActor
an APawn is a UObject
Package - World - Level - Actor - Component

Component 상속구조
UActorComponent
- USceneComponent
- UPrimitiveComponent
- MeshComponent
- ShapeComponent
- UPrimitiveComponent
아래는 SplineMeshComponent 동적생성 예시
#include "Components/SplineComponent.h" void ClassName() { UClass* MyClass = USplineMeshComponent::StaticClass(); FTransform RelativeTransform = FTransform(); // Case 1 if (USplineMeshComponent* NewSplineMeshComp = NewObject<USplineMeshComponent>(RootComponent)) { NewSplineMeshComp->SetRelativeTransform(RelativeTransform); NewSplineMeshComp->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform); NewSplineMeshComp->RegisterComponent(); // 까먹지 않고 등록해주기! } // Case 2 UActorComponent* ActorComponent = AddComponentByClass( USplineMeshComponent::StaticClass(), true, RelativeTransform, false); if (USplineMeshComponent* SplineMeshComponent = Cast<USplineMeshComponent>(ActorComponent)) { SplineMeshComponent->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform); SplineMeshComponent->RegisterComponent(); } }
'⭐ Unreal Engine > UE 개념정리' 카테고리의 다른 글
[Unreal] 컴파일 과정 (UBT, UHT 호출시점) (1) | 2023.09.11 |
---|---|
[Unreal] Assert란? Assert 3종류: Check, Verify, Ensure (0) | 2023.06.13 |
[Unreal] Unreal Authority (0) | 2023.04.06 |
RPC (Remote Procedure Call) - 네트워크를 통한 함수 리플리케이션 지정하기 (0) | 2023.04.06 |
[Unreal] 이벤트 디스패처 Event Dispatcher (0) | 2023.04.02 |
댓글
이 글 공유하기
다른 글
-
[Unreal] 컴파일 과정 (UBT, UHT 호출시점)
[Unreal] 컴파일 과정 (UBT, UHT 호출시점)
2023.09.11 -
[Unreal] Assert란? Assert 3종류: Check, Verify, Ensure
[Unreal] Assert란? Assert 3종류: Check, Verify, Ensure
2023.06.13 -
[Unreal] Unreal Authority
[Unreal] Unreal Authority
2023.04.06 -
RPC (Remote Procedure Call) - 네트워크를 통한 함수 리플리케이션 지정하기
RPC (Remote Procedure Call) - 네트워크를 통한 함수 리플리케이션 지정하기
2023.04.06
댓글을 사용할 수 없습니다.