



https://github.com/dnjfs/ArenaBattle/commit/df7e5bbc8e0e1a7d9e16c5aa601eb9fcf245496d
UABGameSingleton& UABGameSingleton::Get()
{
UABGameSingleton* Singleton = CastChecked<UABGameSingleton>(GEngine->GameSingleton);
if (Singleton)
return *Singleton;
UE_LOG(LogABGameSingleton, Error, TEXT("Invalid Game Singleton"));
return *NewObject<UABGameSingleton>();
}
에셋 비동기 로딩
UAssetManager::Get().GetStreamableManager().RequestAsyncLoad(const FSoftObjectPath&, TFunction<void()>&&)
로딩 완료 시 콜백 함수 호출
액터 지연 생성
UWorld::SpawnActorDeferred<T>(UClass*, FTransform const&) 함수로 지연 생성 후 초기값 세팅 후
AActor::FinishSpawning(const FTransform&) 함수로 마무리
const FTransform SpawnTransform(GetActorLocation() + FVector::UpVector * 88.0f);
AABCharacterNonPlayer* ABOpponentCharacter = GetWorld()->SpawnActorDeferred<AABCharacterNonPlayer>(OpponentClass, SpawnTransform);
if (ABOpponentCharacter)
{
ABOpponentCharacter->OnDestroyed.AddDynamic(this, &AABStageGimmick::OnOpponentDestroyed);
ABOpponentCharacter->SetLevel(CurrentStageNum);
ABOpponentCharacter->FinishSpawning(SpawnTransform);
}