8#include "CoreMinimal.h"
9#include "Engine/Texture2D.h"
10#include "Internationalization/Text.h"
11#include "GameFramework/Actor.h"
13#include "UObject/ObjectPtr.h"
15#include "Engine/StaticMesh.h"
16#include "Engine/Texture2D.h"
17#include "Components/StaticMeshComponent.h"
19#include "ActorAsset.generated.h"
30 UPROPERTY(EditAnywhere, BlueprintReadOnly)
31 FString UniqueIdentifier;
33 UPROPERTY(EditAnywhere, BlueprintReadOnly)
36 UPROPERTY(EditAnywhere, BlueprintReadOnly)
37 TSubclassOf<AActor> Actor;
39 UPROPERTY(EditAnywhere, BlueprintReadOnly)
40 TObjectPtr<UStaticMesh> StaticMesh;
42 UPROPERTY(EditAnywhere, BlueprintReadOnly)
43 TObjectPtr<UTexture2D> Image;
45 UPROPERTY(EditAnywhere, BlueprintReadOnly)
48 UPROPERTY(EditAnywhere, BlueprintReadOnly)
49 float DefaultHeightOffset = 0;
51 UPROPERTY(EditAnywhere, BlueprintReadOnly)
52 float SpawnHeightOffset = 0;
54 UPROPERTY(EditAnywhere, BlueprintReadOnly)
55 bool SnapToGround = false;
59 UniqueIdentifier = FGuid::NewGuid().ToString();
70 AActor* DefaultActor = Actor->GetDefaultObject<AActor>();
73 UStaticMeshComponent* StaticMeshComponent = DefaultActor->FindComponentByClass<UStaticMeshComponent>();
74 if (StaticMeshComponent)
76 return StaticMeshComponent->GetStaticMesh();
UStaticMesh * GetDefaultStaticMeshFromActor()