LifePlay-Revival/Plugins/StreetMap/Source/StreetMapImporting/StreetMapActorFactory.cpp
edujiro5972 1122e17fa6 L0 : etat initial du projet 5.5 avant toute correction
Instantane de reference de la reprise de migration (2026-09-29).
Contient GI.uasset tel que trouve (copie UE4 identique a 4.27,
MD5 F4550DA5DC05FC005400CDCA2FC123C9). Ajouts de ce commit :
.gitattributes (aucune conversion de fin de ligne), regles .gitignore
CHG-001, Tools/ (Snapshot, Restore, AssetHeaders), empreintes L0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 00:56:10 +02:00

29 lines
1 KiB
C++

#include "StreetMapActorFactory.h"
#include "AssetRegistry/AssetData.h"
#include "StreetMapActor.h"
#include "StreetMapComponent.h"
#include "StreetMap.h"
UStreetMapActorFactory::UStreetMapActorFactory(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
DisplayName = NSLOCTEXT("StreetMap", "StreetMapFactoryDisplayName", "Add StreetMap Actor");
NewActorClass = AStreetMapActor::StaticClass();
}
void UStreetMapActorFactory::PostSpawnActor(UObject* Asset, AActor* NewActor)
{
Super::PostSpawnActor(Asset, NewActor);
if (UStreetMap* StreetMapAsset = Cast<UStreetMap>(Asset))
{
AStreetMapActor* StreetMapActor = CastChecked<AStreetMapActor>(NewActor);
UStreetMapComponent* StreetMapComponent = StreetMapActor->GetStreetMapComponent();
StreetMapComponent->SetStreetMap(StreetMapAsset, false, true);
}
}
bool UStreetMapActorFactory::CanCreateActorFrom(const FAssetData& AssetData, FText& OutErrorMsg)
{
return (AssetData.IsValid() && AssetData.GetClass()->IsChildOf(UStreetMap::StaticClass()));
}