KLingo Project Documentation 1.0.0
Unreal Engine 5.6 C++ Project Documentation
로딩중...
검색중...
일치하는것 없음
ABroadcastTrigger 클래스 참조

#include <ABroadcastTrigger.h>

+ ABroadcastTrigger에 대한 상속 다이어그램 :
+ ABroadcastTrigger에 대한 협력 다이어그램:

Public 멤버 함수

 ABroadcastTrigger ()
 
void OnActivate ()
 
virtual void OnActivate_Implementation ()
 
virtual void Tick (float DeltaTime) override
 

Protected 멤버 함수

virtual void BeginPlay () override
 
void OnTriggerBeginOverlap (UPrimitiveComponent *OverlappedComponent, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult)
 트리거 박스 Overlap 시작 이벤트 핸들러
 

Protected 속성

bool bIsTriggered
 트리거 활성화 상태 (false = 활성화, true = 비활성화)
 
bool bShowDebugBox
 디버그 드로우 표시 여부
 
FColor DebugBoxColor
 디버그 박스 색상
 
TObjectPtr< class UBoxComponent > TriggerBox
 트리거 영역을 정의하는 박스 컴포넌트
 

상세한 설명

ABroadcastTrigger.h 파일의 10 번째 라인에서 정의되었습니다.

생성자 & 소멸자 문서화

◆ ABroadcastTrigger()

ABroadcastTrigger::ABroadcastTrigger ( )

ABroadcastTrigger.cpp 파일의 11 번째 라인에서 정의되었습니다.

12{
13 PrimaryActorTick.bCanEverTick = true;
14 bReplicates = true;
15
16 // 루트 컴포넌트로 BoxComponent 생성
17 TriggerBox = CreateDefaultSubobject<UBoxComponent>(TEXT("TriggerBox"));
18 RootComponent = TriggerBox;
19
20 // 박스 크기 기본값 설정
21 TriggerBox->SetBoxExtent(FVector(100.0f, 100.0f, 100.0f));
22
23 // Overlap 이벤트 활성화
24 TriggerBox->SetGenerateOverlapEvents(true);
25 TriggerBox->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
26 TriggerBox->SetCollisionResponseToAllChannels(ECR_Ignore);
27 TriggerBox->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
28
29 // 초기값 설정
30 bIsTriggered = false;
31 bShowDebugBox = true;
32 DebugBoxColor = FColor::Green;
33}
TObjectPtr< class UBoxComponent > TriggerBox
트리거 영역을 정의하는 박스 컴포넌트
bool bIsTriggered
트리거 활성화 상태 (false = 활성화, true = 비활성화)
FColor DebugBoxColor
디버그 박스 색상
bool bShowDebugBox
디버그 드로우 표시 여부

다음을 참조함 : bIsTriggered, bShowDebugBox, DebugBoxColor, TriggerBox.

멤버 함수 문서화

◆ BeginPlay()

void ABroadcastTrigger::BeginPlay ( )
overrideprotectedvirtual

ABroadcastTrigger.cpp 파일의 35 번째 라인에서 정의되었습니다.

36{
37 Super::BeginPlay();
38
39 if (TriggerBox)
40 TriggerBox->OnComponentBeginOverlap.AddDynamic(this, &ABroadcastTrigger::OnTriggerBeginOverlap);
41}
void OnTriggerBeginOverlap(UPrimitiveComponent *OverlappedComponent, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult)
트리거 박스 Overlap 시작 이벤트 핸들러

다음을 참조함 : OnTriggerBeginOverlap(), TriggerBox.

+ 이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ OnActivate()

void ABroadcastTrigger::OnActivate ( )

다음에 의해서 참조됨 : OnTriggerBeginOverlap().

+ 이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ OnActivate_Implementation()

void ABroadcastTrigger::OnActivate_Implementation ( )
virtual

ABroadcastTrigger.cpp 파일의 108 번째 라인에서 정의되었습니다.

109{
110 PRINT_STRING(TEXT("ABroadcastTrigger Activated"));
111}
#define PRINT_STRING(fmt,...)
Definition GameLogging.h:45

다음을 참조함 : PRINT_STRING.

◆ OnTriggerBeginOverlap()

void ABroadcastTrigger::OnTriggerBeginOverlap ( UPrimitiveComponent *  OverlappedComponent,
AActor *  OtherActor,
UPrimitiveComponent *  OtherComp,
int32  OtherBodyIndex,
bool  bFromSweep,
const FHitResult &  SweepResult 
)
protected

트리거 박스 Overlap 시작 이벤트 핸들러

ABroadcastTrigger.cpp 파일의 89 번째 라인에서 정의되었습니다.

93{
94 // 이미 트리거되었으면 무시
95 if (bIsTriggered)
96 return;
97
98 // PlayerActor인지 확인
99 APlayerActor* PlayerActor = Cast<APlayerActor>(OtherActor);
100 if (PlayerActor)
101 {
102 OnActivate();
103
104 bIsTriggered = true;
105 }
106}
Main character driven directly by the player.

다음을 참조함 : bIsTriggered, OnActivate().

다음에 의해서 참조됨 : BeginPlay().

+ 이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
+ 이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ Tick()

void ABroadcastTrigger::Tick ( float  DeltaTime)
overridevirtual

ABroadcastTrigger.cpp 파일의 43 번째 라인에서 정의되었습니다.

44{
45 Super::Tick(DeltaTime);
46
48 {
49 FVector BoxCenter = TriggerBox->GetComponentLocation();
50 FVector BoxExtent = TriggerBox->GetScaledBoxExtent();
51 FRotator BoxRotation = TriggerBox->GetComponentRotation();
52
53 // 디버그 박스 표시 (트리거 활성화 상태일 때만)
54 if (!bIsTriggered)
55 {
56 DrawDebugBox(
57 GetWorld(),
58 BoxCenter,
59 BoxExtent,
60 BoxRotation.Quaternion(),
62 false,
63 -1.0f,
64 0,
65 2.0f
66 );
67 }
68
69 // 트리거 정보를 텍스트로 표시
70 FString StatusText = bIsTriggered ? TEXT("[TRIGGERED]") : TEXT("[ACTIVE]");
71 FColor TextColor = bIsTriggered ? FColor::Red : FColor::Green;
72
73 FVector TextLocation = BoxCenter + FVector(0.0f, 0.0f, BoxExtent.Z + 50.0f);
74
75 // 상태 표시
76 DrawDebugString(
77 GetWorld(),
78 TextLocation,
79 StatusText,
80 nullptr,
81 TextColor,
82 0.0f,
83 true,
84 1.2f
85 );
86 }
87}

다음을 참조함 : bIsTriggered, bShowDebugBox, DebugBoxColor, TriggerBox.

멤버 데이터 문서화

◆ bIsTriggered

bool ABroadcastTrigger::bIsTriggered
protected

트리거 활성화 상태 (false = 활성화, true = 비활성화)

ABroadcastTrigger.h 파일의 34 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ABroadcastTrigger(), OnTriggerBeginOverlap(), Tick().

◆ bShowDebugBox

bool ABroadcastTrigger::bShowDebugBox
protected

디버그 드로우 표시 여부

ABroadcastTrigger.h 파일의 38 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ABroadcastTrigger(), Tick().

◆ DebugBoxColor

FColor ABroadcastTrigger::DebugBoxColor
protected

디버그 박스 색상

ABroadcastTrigger.h 파일의 42 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ABroadcastTrigger(), Tick().

◆ TriggerBox

TObjectPtr<class UBoxComponent> ABroadcastTrigger::TriggerBox
protected

트리거 영역을 정의하는 박스 컴포넌트

ABroadcastTrigger.h 파일의 30 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ABroadcastTrigger(), BeginPlay(), Tick().


이 클래스에 대한 문서화 페이지는 다음의 파일들로부터 생성되었습니다.: