블로그 내용을 설명하는 두줄 내지 3줄 정도의 글이 첫 문단인 여기에 와야 합니다. 여기에는 키워드 또한 반드시 적혀 있어야 합니다. 검색엔진에서 검색결과 글 내용의 일부를 보여주는데, 바로 여기 첫 문단의 글이 보통 노출이 됩니다.
C++로 Collision 생성과 충돌 함수, 동적 바인딩
Collision 생성
// 헤더파일
UPROPERTY(EditAnywhere, BlueprintReadWrite)
class USphereComponent* DialogCollision;
// 생성자
#include "Components/SphereComponent.h"
DialogCollision = CreateDefaultSubobject<USphereComponent>("TRIGGER");
DialogCollision->SetupAttachment(GetSprite());
동적 바인딩
// PostInitializeComponents()
DialogCollision->OnComponentBeginOverlap.AddDynamic(this, &MyCharacter::OnOverlapBegin);
DialogCollision->OnComponentEndOverlap.AddDynamic(this, &MyCharacter::OnOverlapEnd);
바인딩 함수의 매개변수
UFUNCTION()
void OnOverlapBegin(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);
UFUNCTION()
void OnOverlapEnd(UPrimitiveComponent* OverlappedComp, AActor* OtherActor,
UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);
UPROPERTY(BlueprintAssignable, Category="Collision")
FComponentBeginOverlapSignature OnComponentBeginOverlap;
UPROPERTY(BlueprintAssignable, Category="Collision")
FComponentEndOverlapSignature OnComponentEndOverlap;
/** Delegate for notification of start of overlap with a specific component */
DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_SixParams( FComponentBeginOverlapSignature,
UPrimitiveComponent, OnComponentBeginOverlap, UPrimitiveComponent*, OverlappedComponent, AActor*, OtherActor, UPrimitiveComponent*, OtherComp, int32, OtherBodyIndex, bool, bFromSweep, const FHitResult &, SweepResult);
/** Delegate for notification of end of overlap with a specific component */
DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_FourParams( FComponentEndOverlapSignature,
UPrimitiveComponent, OnComponentEndOverlap, UPrimitiveComponent*, OverlappedComponent, AActor*, OtherActor, UPrimitiveComponent*, OtherComp, int32, OtherBodyIndex);
바인딩 함수
마무리 맨트는 이부분 정도에, 글이 끝나기 전에, 다시한번 이번 글의 요약을 써주시는것이 좋습니다. 물론 여기에도 키워드가 다시 반복이 되는것을 추천 드립니다.
추천글
이부분에는 플러그인 -> 이전글 발행 기능을 이용해서 이 글과 관련되거나 추천할 만한 글 몇개의 링크를 걸어주시는걸 추천 드립니다.
반응형
'언리얼' 카테고리의 다른 글
[Unreal] EQS Test와 Context (0) | 2023.09.19 |
---|---|
[Unreal] 내가 겪은 에러 모음 (2) | 2023.07.29 |
[Unreal] Spline을 이용한 캐릭터 이동 (0) | 2023.07.29 |