구조체 중에 GENERATED_BODY 를 갖는 구조체 ( 직렬화된 구조체 )라면 반드시 클래스 위에 있어야한다
BlueprintNativeEvent
C에서 기본 기능을 제공해주고 블프에서 할 일이 있으면 재정의해서 써라 ~
UFUNCTION(BlueprintNativeEvent)
void Eqeuip();
void Equip_Implementation();
Native는 Implementation을 붙여서 기본 정의를 해준다
UObject는 NewObject로 동적할당
UObject를 직접 상속받은 애는 자신의 World가 없다
UCLASS(Abstract)
클래스가 어떠한 기능도 없고 객체화 되면 안될 때 Abstract를 붙여서 추상으로 만들어준다
상속에 의해서만 구현된다
NotBlueprintable은 상속이 된다
Abstract는 상속되지 않는다
UShapeComponent
아래에 UCapsuleComponent, UBoxComponent, USphereComponent가 있다
//CAttachment.h //BeginPlay()
TArray<USceneComponent*> children;
Root->GetChildrenComponents(true, children);
for(USceneComponent* child : children)
{
UShapeComponent* shape = Cast<UShapeComponent>(child);
if(!!shape)
{
Collisions.Add(shape);
}
}
Root에 붙어있는 컴포넌트들을 가져와서 ShapeComponent로 캐스팅이 되는지 확인
캐스팅 된다면 Box, Capsule, Sphere중 하나이니 collisions에 add한다
'> Project > Unreal4 C++' 카테고리의 다른 글
[Unreal4 C++] 공격하는 Enemy AI의 수 제한 (0) | 2024.01.27 |
---|---|
[Unreal4 C++] 베지에 곡선을 활용한 Boss_Skill (0) | 2023.11.01 |
[Unreal4 C++] 04 강참조/약참조 (0) | 2023.09.12 |
[Unreal4 C++] 02 Weapon Attachment, BackRoll (0) | 2023.07.18 |
[Unreal4 C++] 01 Movement (0) | 2023.07.07 |