5#include "Components/BoxComponent.h"
6#include "DrawDebugHelpers.h"
8#include "GameFramework/PlayerController.h"
17 PrimaryActorTick.bCanEverTick =
true;
21 TriggerBox = CreateDefaultSubobject<UBoxComponent>(TEXT(
"TriggerBox"));
25 TriggerBox->SetBoxExtent(FVector(100.0f, 100.0f, 100.0f));
29 TriggerBox->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
30 TriggerBox->SetCollisionResponseToAllChannels(ECR_Ignore);
31 TriggerBox->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
51 Super::Tick(DeltaTime);
55 FVector BoxCenter =
TriggerBox->GetComponentLocation();
56 FVector BoxExtent =
TriggerBox->GetScaledBoxExtent();
57 FRotator BoxRotation =
TriggerBox->GetComponentRotation();
66 BoxRotation.Quaternion(),
76 FString StatusText =
bIsTriggered ? TEXT(
"[TRIGGERED]") : TEXT(
"[ACTIVE]");
77 FColor TextColor =
bIsTriggered ? FColor::Red : FColor::Green;
79 FVector TextLocation = BoxCenter + FVector(0.0f, 0.0f, BoxExtent.Z + 50.0f);
96 UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
97 UPrimitiveComponent* OtherComp, int32 OtherBodyIndex,
98 bool bFromSweep,
const FHitResult& SweepResult)
105 APlayerActor* PlayerActor = Cast<APlayerActor>(OtherActor);
109 if (APlayerController* PC = Cast<APlayerController>(PlayerActor->GetController()))
111 if (PC->IsLocalPlayerController())
122 if (
auto KLingoNetwork = UKLingoNetworkSystem::Get(GetWorld()))
126 KLingoNetwork->RequestEvaluationResult(
134 PRINTLOG(TEXT(
"UKLingoNetworkSystem not found!"));
142 PRINTLOG(TEXT(
"--- Evaluation Result SUCCESS ---"));
144 if (
auto Popup = UPopupManager::ShowPopupAs<UPopup_Evaluation>( GetWorld(), EPopupType::Evaluation))
145 Popup->InitPopup(ResponseData);
149 PRINTLOG(TEXT(
"--- OCR Extract FAILED ---"));
Declares the player-controlled character actor.
YiSan 전반에서 사용하는 공용 인터페이스를 선언합니다.
#define PRINTLOG(fmt,...)
KLingo API 요청을 담당하는 서브시스템을 선언합니다.
virtual void BeginPlay() override
void OnResponseEvaluationResult(FResponseEvaluationResult &ResponseData, bool bWasSuccessful)
FColor DebugBoxColor
디버그 박스 색상
virtual void Tick(float DeltaTime) override
virtual void OnActivate_Implementation()
void OnTriggerBeginOverlap(UPrimitiveComponent *OverlappedComponent, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult)
트리거 박스 Overlap 시작 이벤트 핸들러
bool bShowDebugBox
디버그 드로우 표시 여부
TObjectPtr< class UBoxComponent > TriggerBox
트리거 영역을 정의하는 박스 컴포넌트
bool bIsTriggered
트리거 활성화 상태 (false = 활성화, true = 비활성화)
Main character driven directly by the player.
ECompassMarkerType MarkerType
static class ALingoGameState * GetLingoGameState(const UObject *WorldContextObject)