Agrarsense
Public Member Functions | Public Attributes | List of all members
FActorAsset Struct Reference

#include <ActorAsset.h>

Public Member Functions

 FActorAsset ()
 
UStaticMesh * GetDefaultStaticMeshFromActor ()
 

Public Attributes

FString UniqueIdentifier
 
EActorAssetType AssetType = EActorAssetType::Unspecified
 
TSubclassOf< AActor > Actor
 
TObjectPtr< UStaticMesh > StaticMesh
 
TObjectPtr< UTexture2D > Image
 
FText DisplayName
 
float DefaultHeightOffset = 0
 
float SpawnHeightOffset = 0
 
bool SnapToGround = false
 

Detailed Description

Definition at line 25 of file ActorAsset.h.

Constructor & Destructor Documentation

◆ FActorAsset()

FActorAsset::FActorAsset ( )
inline

Definition at line 57 of file ActorAsset.h.

58 {
59 UniqueIdentifier = FGuid::NewGuid().ToString();
60 }
FString UniqueIdentifier
Definition: ActorAsset.h:31

Member Function Documentation

◆ GetDefaultStaticMeshFromActor()

UStaticMesh * FActorAsset::GetDefaultStaticMeshFromActor ( )
inline

Get the default static mesh from the actor if one provides one

Returns
StaticMesh, or nullptr if not found

Definition at line 66 of file ActorAsset.h.

67 {
68 if (Actor)
69 {
70 AActor* DefaultActor = Actor->GetDefaultObject<AActor>();
71 if (DefaultActor)
72 {
73 UStaticMeshComponent* StaticMeshComponent = DefaultActor->FindComponentByClass<UStaticMeshComponent>();
74 if (StaticMeshComponent)
75 {
76 return StaticMeshComponent->GetStaticMesh();
77 }
78 }
79 }
80
81 return nullptr;
82 }
TSubclassOf< AActor > Actor
Definition: ActorAsset.h:37

Referenced by UActorAssetDataAsset::GetDefaultStaticMeshFromActor().

Member Data Documentation

◆ Actor

TSubclassOf<AActor> FActorAsset::Actor

◆ AssetType

Definition at line 34 of file ActorAsset.h.

◆ DefaultHeightOffset

float FActorAsset::DefaultHeightOffset = 0

Definition at line 49 of file ActorAsset.h.

◆ DisplayName

FText FActorAsset::DisplayName

Definition at line 46 of file ActorAsset.h.

◆ Image

TObjectPtr<UTexture2D> FActorAsset::Image

Definition at line 43 of file ActorAsset.h.

◆ SnapToGround

bool FActorAsset::SnapToGround = false

Definition at line 55 of file ActorAsset.h.

◆ SpawnHeightOffset

float FActorAsset::SpawnHeightOffset = 0

Definition at line 52 of file ActorAsset.h.

◆ StaticMesh

TObjectPtr<UStaticMesh> FActorAsset::StaticMesh

Definition at line 40 of file ActorAsset.h.

◆ UniqueIdentifier

FString FActorAsset::UniqueIdentifier

Definition at line 31 of file ActorAsset.h.


The documentation for this struct was generated from the following file: