Overhauling asset loading

This commit is contained in:
2025-11-14 02:41:44 -05:00
parent 297cd2f068
commit 3215efeef3
7 changed files with 180 additions and 192 deletions

View File

@@ -59,11 +59,12 @@ void UlxTangible::SetActorBlueprint(const FString &XName) {
return;
}
UClass *blueprint = UlxAssetLookup::LoadTangibleBlueprintAsset(this, Name);
if (blueprint == nullptr)
TSubclassOf<AActor> Blueprint;
UlxAssetLookup::LoadTangibleBlueprintAsset(Blueprint, this, Name);
if (Blueprint == nullptr)
{
blueprint = UlxAssetLookup::LoadTangibleBlueprintAsset(this, DEFAULT_BLUEPRINT);
check(blueprint != nullptr);
UlxAssetLookup::LoadTangibleBlueprintAsset(Blueprint, this, DEFAULT_BLUEPRINT);
check(Blueprint != nullptr);
}
// Update the blueprint name
@@ -109,7 +110,7 @@ void UlxTangible::SetActorBlueprint(const FString &XName) {
};
UE_LOG(LogLuprexIntegration, Display, TEXT("Creating Actor: %s"), *params.Name.ToString());
AActor* a = w->SpawnActor(blueprint, &transform, params);
AActor* a = w->SpawnActor(Blueprint, &transform, params);
check(a != nullptr);
CurrentActor = a;
}