Reduce coupling in the unreal side
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
#include "AssetRegistry/IAssetRegistry.h"
|
||||
#include "AssetRegistry/AssetData.h"
|
||||
#include "AssetRegistry/AssetRegistryState.h"
|
||||
#include "LuprexGameModeBase.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
#include "Components/Widget.h"
|
||||
#include "WidgetBlueprint.h"
|
||||
#include "Blueprint/UserWidget.h"
|
||||
@@ -15,6 +15,12 @@
|
||||
const ElxValidOrNotValid NotValid = ElxValidOrNotValid::NotValid;
|
||||
const ElxValidOrNotValid Valid = ElxValidOrNotValid::Valid;
|
||||
|
||||
void UlxAssetLookup::Initialize(FSubsystemCollectionBase& Collection)
|
||||
{
|
||||
Super::Initialize(Collection);
|
||||
RebuildIndex();
|
||||
}
|
||||
|
||||
void UlxAssetLookup::RebuildIndex()
|
||||
{
|
||||
IAssetRegistry::GetChecked().WaitForCompletion();
|
||||
@@ -63,7 +69,7 @@ void UlxAssetLookup::ReportFailedLoad(const FString &ClassName, const FString &N
|
||||
|
||||
UObject *UlxAssetLookup::LoadAsset(const UObject *Context, UClass *Class, UClass *ChildOf, const FString &Name)
|
||||
{
|
||||
const UlxAssetLookup *Lookup = ALuprexGameModeBase::FromContext(Context)->GetAssetLookup();
|
||||
const UlxAssetLookup *Lookup = UGameplayStatics::GetGameInstance(Context)->GetSubsystem<UlxAssetLookup>();
|
||||
const FString *Path = Lookup->AssetPaths.Find(MakeTuple(Class->GetName(), FName(Name)));
|
||||
if (Path == nullptr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user