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

#include <InteractableSpawnSystemComponent.h>

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

Public 멤버 함수

 UInteractableSpawnSystemComponent ()
 
virtual void Initialize (UStageManagementSubsystem *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 AInteractableActorGetRecentlySpawnInteractableActor () const
 

Private 속성

TWeakObjectPtr< UStageManagementSubsystemStageManagementSystem
 
TArray< TObjectPtr< AInteractableActor > > SpawnedInteractableActors
 

생성자 & 소멸자 문서화

◆ UInteractableSpawnSystemComponent()

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

멤버 함수 문서화

◆ ClearAll()

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

ISpawnSystemInterface를 구현.

27{
28 if (SpawnedInteractableActors.IsEmpty())
29 {
30 return;
31 }
32
33 if (!bClearSpawnedActors)
34 {
36 return;
37 }
38
39 UPoolWorldSubsystem* Pool = GetWorld()->GetSubsystem<UPoolWorldSubsystem>();
40
41 for (auto Interactable : SpawnedInteractableActors)
42 {
43 if (IsValid(Interactable) == false || Interactable == nullptr)
44 {
45 continue;
46 }
47
48 if (Pool && Interactable->Implements<UObjectPoolingInterface>())
49 {
50 Pool->ReturnActorToPool(Interactable);
51 }
52 else
53 {
54 Interactable->Destroy();
55 }
56 }
57
59}
TArray< TObjectPtr< AInteractableActor > > SpawnedInteractableActors
Definition InteractableSpawnSystemComponent.h:49
Definition ObjectPoolingInterface.h:12
Definition PoolWorldSubsystem.h:28
void ReturnActorToPool(AActor *ActorToReturn)
Definition PoolWorldSubsystem.cpp:272
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ CollectSpawnedTargetables()

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

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

63{
65 {
66 if (ITargetableInterface* Targetable = Cast<ITargetableInterface>(Interactable))
67 {
68 OutTargetables.Add(Targetable);
69 }
70 }
71}
Definition InteractableActor.h:16
Definition TargetableInterface.h:20

◆ DespawnInteractableActor()

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

◆ 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 ( UStageManagementSubsystem InStageManagementSubsystem)
overridevirtual

ISpawnSystemInterface를 구현.

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

◆ SpawnInteractableActor()

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

멤버 데이터 문서화

◆ SpawnedInteractableActors

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

◆ StageManagementSystem

TWeakObjectPtr<UStageManagementSubsystem> UInteractableSpawnSystemComponent::StageManagementSystem
private

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