Payback 0.0.1
CK Graduation Project
로딩중...
검색중...
일치하는것 없음
UInteractableSpawnSystemComponent 클래스 참조

#include <InteractableSpawnSystemComponent.h>

UInteractableSpawnSystemComponent에 대한 상속 다이어그램 :
Inheritance graph
UInteractableSpawnSystemComponent에 대한 협력 다이어그램:
Collaboration graph

Public 멤버 함수

 UInteractableSpawnSystemComponent ()
 
virtual void Initialize (UStageSubsystem *InStageManagementSubsystem) override
 
virtual void ClearAll (const bool bClearSpawnedActors=true) override
 
virtual void CollectSpawnedTargetables (TArray< ITargetableInterface * > &OutTargetables) const override
 
AActor * SpawnInteractableActor (TSubclassOf< AActor > InteractableClass, const FVector &Location, const FRotator &Rotation)
 
void DespawnInteractableActor (AActor *Interactable)
 
FORCEINLINE TArray< AInteractableActor * > GetAllSpawnedInteractableActors () const
 
FORCEINLINE AInteractableActor * GetRecentlySpawnInteractableActor () const
 

Private 속성

TWeakObjectPtr< UStageSubsystem > StageManagementSystem
 
TArray< TObjectPtr< AInteractableActor > > SpawnedInteractableActors
 

추가로 상속된 멤버들

- ISpawnSystemInterface(으)로부터 상속된 정적 Protected 멤버 함수
static void CollectActorTargetables (AActor *SpawnedActor, TArray< ITargetableInterface * > &OutTargetables)
 

생성자 & 소멸자 문서화

◆ UInteractableSpawnSystemComponent()

UInteractableSpawnSystemComponent::UInteractableSpawnSystemComponent ( )
16{
17 PrimaryComponentTick.bCanEverTick = false;
18}

멤버 함수 문서화

◆ ClearAll()

void UInteractableSpawnSystemComponent::ClearAll ( const bool  bClearSpawnedActors = true)
overridevirtual

ISpawnSystemInterface를 구현.

28{
29 if (SpawnedInteractableActors.IsEmpty())
30 {
31 return;
32 }
33
34 if (!bClearSpawnedActors)
35 {
37 return;
38 }
39
40 UPoolWorldSubsystem* Pool = GetWorld()->GetSubsystem<UPoolWorldSubsystem>();
41
42 for (auto Interactable : SpawnedInteractableActors)
43 {
44 if (IsValid(Interactable) == false || Interactable == nullptr)
45 {
46 continue;
47 }
48
49 if (Pool && Interactable->Implements<UObjectPoolingInterface>())
50 {
51 Pool->ReturnActorToPool(Interactable);
52 }
53 else
54 {
55 Interactable->Destroy();
56 }
57 }
58
60}
TArray< TObjectPtr< AInteractableActor > > SpawnedInteractableActors
Definition InteractableSpawnSystemComponent.h:49
Definition ObjectPoolingInterface.h:12
Definition PoolWorldSubsystem.h:28
void ReturnActorToPool(AActor *ActorToReturn)
Definition PoolWorldSubsystem.cpp:272

다음을 참조함 : UPoolWorldSubsystem::ReturnActorToPool(), SpawnedInteractableActors.

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

◆ CollectSpawnedTargetables()

void UInteractableSpawnSystemComponent::CollectSpawnedTargetables ( TArray< ITargetableInterface * > &  OutTargetables) const
overridevirtual

ISpawnSystemInterface(으)로부터 재구현되었습니다.

64{
66 {
67 CollectActorTargetables(Interactable, OutTargetables);
68 }
69}
Definition InteractableActor.h:16
static void CollectActorTargetables(AActor *SpawnedActor, TArray< ITargetableInterface * > &OutTargetables)
Definition SpawnSystemInterface.cpp:10

다음을 참조함 : ISpawnSystemInterface::CollectActorTargetables(), SpawnedInteractableActors.

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

◆ DespawnInteractableActor()

void UInteractableSpawnSystemComponent::DespawnInteractableActor ( AActor *  Interactable)
99{
100 if (IsValid(Interactable) == false)
101 {
102 LOG_ERROR(LogCK, "인자로 넘어온 %s가 유효하지 않습니다.", NAMEOF(AActor));
103 return;
104 }
105
106 const int32 Removed = SpawnedInteractableActors.RemoveAll([Interactable](const AInteractableActor* Entry)
107 {
108 return Entry == Interactable;
109 });
110
111 if (Removed == 0)
112 {
113 LOG_WARNING(LogCK, "'%s'은(는) %s에 등록되지 않은 객체입니다.", *Interactable->GetName(), NAMEOF(UInteractableSpawnSystemComponent));
114 return;
115 }
116
117 if (Interactable->Implements<UObjectPoolingInterface>())
118 {
119 UPoolWorldSubsystem* Pool = GetWorld()->GetSubsystem<UPoolWorldSubsystem>();
120 check(Pool);
121
122 Pool->ReturnActorToPool(Interactable);
123 return;
124 }
125
126 Interactable->Destroy();
127}
#define LOG_ERROR(Category, Format,...)
Definition CK_UE.h:41
#define NAMEOF(Type)
Definition CK_UE.h:31
#define LOG_WARNING(Category, Format,...)
Definition CK_UE.h:40
Definition InteractableSpawnSystemComponent.h:18

다음을 참조함 : LOG_ERROR, LOG_WARNING, NAMEOF, UPoolWorldSubsystem::ReturnActorToPool(), SpawnedInteractableActors.

다음에 의해서 참조됨 : UGuardianCrownComponent::ClearCrownComp(), ATargetableWeapon::OnBeginInteraction().

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

◆ GetAllSpawnedInteractableActors()

FORCEINLINE TArray< AInteractableActor * > UInteractableSpawnSystemComponent::GetAllSpawnedInteractableActors ( ) const
inline
35 {
37 }

◆ GetRecentlySpawnInteractableActor()

FORCEINLINE AInteractableActor * UInteractableSpawnSystemComponent::GetRecentlySpawnInteractableActor ( ) const
inline
40 {
41 return SpawnedInteractableActors.IsEmpty() ? nullptr : SpawnedInteractableActors.Last();
42 }

◆ Initialize()

void UInteractableSpawnSystemComponent::Initialize ( UStageSubsystem *  InStageManagementSubsystem)
overridevirtual

ISpawnSystemInterface를 구현.

22{
23 StageManagementSystem = InStageManagementSubsystem;
24}
TWeakObjectPtr< UStageSubsystem > StageManagementSystem
Definition InteractableSpawnSystemComponent.h:46

다음을 참조함 : StageManagementSystem.

◆ SpawnInteractableActor()

AActor * UInteractableSpawnSystemComponent::SpawnInteractableActor ( TSubclassOf< AActor >  InteractableClass,
const FVector &  Location,
const FRotator &  Rotation 
)
73{
74 if (!InteractableClass)
75 {
76 LOG_ERROR(LogCK, "InteractableClass가 nullptr입니다.");
77 return nullptr;
78 }
79
80 UPoolWorldSubsystem* Pool = GetWorld()->GetSubsystem<UPoolWorldSubsystem>();
81
82 if (Pool == nullptr)
83 {
84 LOG_ERROR(LogCK, "%s를 가져올 수 없습니다.", NAMEOF(UPoolWorldSubsystem));
85 return nullptr;
86 }
87
88 AActor* Spawned = Pool->GetActorFromPool(InteractableClass, Location, Rotation);
89
90 if (AInteractableActor* Interactable = Cast<AInteractableActor>(Spawned))
91 {
92 SpawnedInteractableActors.Add(Interactable);
93 }
94
95 return Spawned;
96}
AActor * GetActorFromPool(TSubclassOf< AActor > ActorClass, FVector Location, FRotator Rotation)
Definition PoolWorldSubsystem.cpp:203

다음을 참조함 : UPoolWorldSubsystem::GetActorFromPool(), LOG_ERROR, NAMEOF, SpawnedInteractableActors.

다음에 의해서 참조됨 : AWeaponProjectile::OnCollided(), UGuardianCrownComponent::SpawnCrown().

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

멤버 데이터 문서화

◆ SpawnedInteractableActors

TArray<TObjectPtr<AInteractableActor> > UInteractableSpawnSystemComponent::SpawnedInteractableActors
private

◆ StageManagementSystem

TWeakObjectPtr<UStageSubsystem> UInteractableSpawnSystemComponent::StageManagementSystem
private

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


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