8#include "CoreMinimal.h"
9#include "Engine/DataAsset.h"
12#include "ActorAssetDataAsset.generated.h"
23 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category =
"Actor Asset Data")
30 UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Actor Asset Data")
31 UStaticMesh* GetDefaultStaticMeshFromActor()
37 void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
39 Super::PostEditChangeProperty(PropertyChangedEvent);
42 FName PropertyName = (PropertyChangedEvent.Property !=
nullptr) ? PropertyChangedEvent.Property->GetFName() : NAME_None;
44 UE_LOG(LogTemp, Warning, TEXT(
"Property changed in the Data Asset!: %s"), *PropertyName.ToString());
46 if (PropertyName == GET_MEMBER_NAME_CHECKED(
FActorAsset, Actor))
50 UStaticMesh* MeshFromActor = GetDefaultStaticMeshFromActor();
53 ActorAsset.StaticMesh = MeshFromActor;
59 if (!ActorAsset.StaticMesh && ActorAsset.Actor)
61 ActorAsset.StaticMesh = GetDefaultStaticMeshFromActor();
UStaticMesh * GetDefaultStaticMeshFromActor()