#include "CoreMinimal.h"
#include "Engine/DeveloperSettings.h"
#include "EnvironmentPathRegistry.generated.h"
이 파일의 소스 코드 페이지로 가기
◆ GetEnvironmentAssetByKey()
template<typename T >
| FORCEINLINE T * GetEnvironmentAssetByKey |
( |
const FName & |
Key | ) |
|
82{
83 if (Key.IsNone())
84 {
85 return nullptr;
86 }
87
89
90 if (Path.IsEmpty())
91 {
92 return nullptr;
93 }
94 else
95 {
96 return TSoftObjectPtr<T>(FSoftObjectPath(Path)).LoadSynchronous();
97 }
98}
FORCEINLINE FString GetEnvironmentPathByKey(const FName &Key)
Definition EnvironmentPathRegistry.h:36
◆ GetEnvironmentPathByKey()
| FORCEINLINE FString GetEnvironmentPathByKey |
( |
const FName & |
Key | ) |
|
등록된 키로 경로 문자열을 반환합니다. DirectoryRegistry → AssetRegistry 순으로 탐색합니다. 키가 없으면 빈 문자열을 반환합니다.
37{
39
41 {
42 return Dir->Path;
43 }
44
45 if (
const FSoftObjectPath* Asset = Settings->
AssetRegistry.Find(Key))
46 {
47 return Asset->ToString();
48 }
49
50 return FString();
51}
Definition EnvironmentPathRegistry.h:12
TMap< FName, FDirectoryPath > DirectoryRegistry
Definition EnvironmentPathRegistry.h:24
TMap< FName, FSoftObjectPath > AssetRegistry
Definition EnvironmentPathRegistry.h:28
◆ GetEnvironmentSoftPtrByKey()
template<typename T >
| FORCEINLINE TSoftObjectPtr< T > GetEnvironmentSoftPtrByKey |
( |
const FName & |
Key | ) |
|
56{
57 if (Key.IsNone())
58 {
59 return nullptr;
60 }
61
63
64 if (Path.IsEmpty())
65 {
66 return nullptr;
67 }
68
69 const FSoftObjectPath ObjectPath = FSoftObjectPath(Path);
70
71 if (!ObjectPath.IsValid())
72 {
73 return nullptr;
74 }
75
76 return TSoftObjectPtr<T>(ObjectPath);
77}