KLingo Project Documentation 1.0.0
Unreal Engine 5.6 C++ Project Documentation
로딩중...
검색중...
일치하는것 없음
UGameVFXManager.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
7#include "UGameVFXManager.h"
8
9#include "EDamageType.h"
10#include "GameLogging.h"
11#include "UVFXDataAsset.h"
12#include "NiagaraFunctionLibrary.h"
13#include "FComponentHelper.h"
14
15#define VFX_DATA_PATH TEXT("/Game/CustomContents/MasterData/VFX_Data.VFX_Data")
16
18{
20 {
21 VFXAsset = LoadedAsset;
22 VFXDataMap = VFXAsset->VFXData;
23 }
24}
25
26void UGameVFXManager::Initialize(FSubsystemCollectionBase& Collection)
27{
28 Super::Initialize(Collection);
29
30 if (!VFXAsset)
31 {
32 UE_LOG(LogTemp, Error, TEXT("Failed to load VFXDataAsset from path"));
33 }
34}
35
36
38{
39 if (const FVFXData* Found = VFXDataMap.Find(Type))
40 {
41 Out = *Found;
42 return true;
43 }
44
45 PRINTLOG(TEXT("DataGetFail : %s"), *UEnum::GetValueAsString(Type) );
46 return false;
47}
48
50 FVector Location, FRotator Rotator, FVector Scale)
51{
52 FVFXData Params;
53 if (!this->GetVFXData(Type, Params))
54 return;
55
56 UNiagaraFunctionLibrary::SpawnSystemAtLocation(
57 GetWorld(),
58 Params.VFXAsset,
59 Location + Params.LocationOffset,
60 Rotator + Params.RotatorOffset,
61 Scale * Params.Scale,
62 true,
63 true,
64 ENCPoolMethod::None,
65 true
66 );
67}
EDamageType 클래스를 선언합니다.
EVFXType
Definition EVFXType.h:9
FComponentHelper 구조체를 선언합니다.
YiSan 전반에서 사용하는 공용 인터페이스를 선언합니다.
#define PRINTLOG(fmt,...)
Definition GameLogging.h:30
#define VFX_DATA_PATH
UGameVFXManager 클래스를 선언합니다.
UNiagaraSystem 클래스를 선언합니다.
void ShowVFX(EVFXType Type, FVector Location, FRotator Rotator, FVector Scale)
bool GetVFXData(EVFXType Type, FVFXData &Out) const
virtual void Initialize(FSubsystemCollectionBase &Collection) override
TMap< EVFXType, FVFXData > VFXDataMap
TObjectPtr< class UVFXDataAsset > VFXAsset
static T * LoadAsset(const TCHAR *Path)
float Scale
FVector LocationOffset
FRotator RotatorOffset
TObjectPtr< class UNiagaraSystem > VFXAsset