KLingo Project Documentation 1.0.0
Unreal Engine 5.6 C++ Project Documentation
로딩중...
검색중...
일치하는것 없음
RespawnTrigger.cpp
이 파일의 문서화 페이지로 가기
1// Copyright (c) 2025 Doppleddiggong. All rights reserved. Unauthorized copying, modification, or distribution of this file, via any medium is strictly prohibited. Proprietary and confidential.
2
3
4#include "RespawnTrigger.h"
5
6#include "Components/BoxComponent.h"
7#include "GameFramework/Character.h"
8
9#define READ_LOCATION FVector(2409.844832,-10722.498133,128.995287)
10#define LISTEN_LOCATION FVector(4440.000000,-3730.000000,-4580.000000)
11
12// Sets default values
14{
15 // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
16 PrimaryActorTick.bCanEverTick = true;
17
18 Collision = CreateDefaultSubobject<UBoxComponent>(TEXT("Collision"));
19 SetRootComponent(Collision);
20
22}
23
24// Called when the game starts or when spawned
26{
27 Super::BeginPlay();
28
29 Collision->OnComponentBeginOverlap.AddDynamic(this, &ARespawnTrigger::BeginOverlap);
30}
31
32// Called every frame
33void ARespawnTrigger::Tick(float DeltaTime)
34{
35 Super::Tick(DeltaTime);
36}
37
38void ARespawnTrigger::BeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
39 UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
40{
41 if (ACharacter* Player = Cast<ACharacter>(OtherActor))
42 {
43 Server_RepawnPlayer(Player);
44 }
45}
46
47void ARespawnTrigger::Server_RepawnPlayer_Implementation(ACharacter* Player)
48{
49 switch (RespawnQuest)
50 {
53 Player->SetActorLocation(READ_LOCATION);
54 break;
56 Player->SetActorLocation(LISTEN_LOCATION);
57 break;
58 default:
59 Player->SetActorLocation(READ_LOCATION);
60 break;
61 }
62}
63
#define READ_LOCATION
#define LISTEN_LOCATION
void BeginOverlap(UPrimitiveComponent *OverlappedComponent, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult)
EQuestType RespawnQuest
virtual void BeginPlay() override
virtual void Tick(float DeltaTime) override
void Server_RepawnPlayer(ACharacter *Player)
class UBoxComponent * Collision