Paradies Project
Loading...
Searching...
No Matches
UObjectPoolSubsystem Class Reference

월드 기반 오브젝트 풀링 시스템을 관리하는 서브시스템입니다. More...

#include <ObjectPoolSubsystem.h>

Inheritance diagram for UObjectPoolSubsystem:
Inheritance graph
Collaboration diagram for UObjectPoolSubsystem:
Collaboration graph

Public Member Functions

template<typename T>
T * SpawnPoolActor (UClass *Class, FVector location, FRotator rotation, AActor *Owner, APawn *Instigator)
 풀에서 액터를 가져올 때 특정 타입(T)으로 캐스팅하여 반환하는 템플릿 함수
AActor * SpawnPooledActor (UClass *Class, FVector location, FRotator rotation, AActor *Owner, APawn *Instigator)
 오브젝트 풀을 조회하여 액터를 가져오거나, 없으면 새로 생성하는 핵심 함수
void PreSpawnPool (UClass *Class, UWorld *World, int32 Count)
 전투 전 렉(GC) 방지를 위해 지정된 개수만큼 액터를 미리 생성하여 풀에 보관합니다.
void ReturnToPool (AActor *InActor)
 사용이 끝난 액터를 풀로 반납(비활성화)하는 함수

Detailed Description

월드 기반 오브젝트 풀링 시스템을 관리하는 서브시스템입니다.

Note
Actor의 재사용 및 관리를 담당합니다.
See also
IObjectPoolInterface

Member Function Documentation

◆ PreSpawnPool()

void UObjectPoolSubsystem::PreSpawnPool ( UClass * Class,
UWorld * World,
int32 Count )

전투 전 렉(GC) 방지를 위해 지정된 개수만큼 액터를 미리 생성하여 풀에 보관합니다.

Parameters
Class생성할 대상 액터의 클래스 (TSubclassOf)
World스폰을 수행할 월드 컨텍스트
Count미리 만들어둘 액터의 개수

◆ ReturnToPool()

void UObjectPoolSubsystem::ReturnToPool ( AActor * InActor)

사용이 끝난 액터를 풀로 반납(비활성화)하는 함수

액터를 즉시 Destroy하지 않고 숨긴 뒤, 풀 큐에 넣습니다. 반납 전 IObjectPoolInterface::OnPoolDeactivate를 호출합니다.

Parameters
InActor풀로 되돌릴 대상 액터

◆ SpawnPoolActor()

template<typename T>
T * UObjectPoolSubsystem::SpawnPoolActor ( UClass * Class,
FVector location,
FRotator rotation,
AActor * Owner,
APawn * Instigator )
inline

풀에서 액터를 가져올 때 특정 타입(T)으로 캐스팅하여 반환하는 템플릿 함수

Template Parameters
T반환받을 액터의 구체적인 클래스 타입 (AActor 상속 필수)
Parameters
Class스폰할 액터의 UClass 정보
location스폰할 월드 위치
rotation스폰할 월드 회전값
Owner액터의 소유자(Owner) 설정
Instigator액터의 가해자(Instigator) 설정
Returns
T* 풀에서 꺼내지거나 새로 생성된, T 타입으로 캐스팅된 액터 포인터
Here is the call graph for this function:

◆ SpawnPooledActor()

AActor * UObjectPoolSubsystem::SpawnPooledActor ( UClass * Class,
FVector location,
FRotator rotation,
AActor * Owner,
APawn * Instigator )

오브젝트 풀을 조회하여 액터를 가져오거나, 없으면 새로 생성하는 핵심 함수

풀(Queue)에 유효한 액터가 있다면 재사용(Reuse)하고, 없다면 SpawnActor를 통해 새로 생성합니다. 가져온 액터에 대해 IObjectPoolInterface::OnPoolActivate를 호출합니다.

Parameters
Class스폰할 대상 UClass
location초기 위치
rotation초기 회전
Owner소유자 액터
Instigator가해자 폰
Returns
AActor* 활성화된 액터의 포인터 (실패 시 nullptr)
Here is the caller graph for this function:

The documentation for this class was generated from the following files:
  • Source/Paradise/Public/Framework/System/ObjectPoolSubsystem.h
  • Source/Paradise/Private/Framework/System/ObjectPoolSubsystem.cpp