枚舉
UENUM宏搭配BlueprintType可以將枚舉暴露給藍圖,不使用的話,僅能在C++使用
//定義一個原生enum class
enum class EMyType
{
Type1,
Type2,
Type3,
};
UENUM(BlueprintType)
enum class ECurrentState : uint8
{
Idle UMETA(DisplayName="空閑"),
Attack UMETA(DisplayName="攻擊"),
Roll UMETA(DisplayName="翻滾"),
Dead UMETA(DisplayName="死亡"),
};
UPROPERTY(EditAnywhere,BlueprintReadWrite)
ECurrentState MyCurrentState UMETA(DisplayName = "當前狀態");

結構體
//結構體
USTRUCT(BlueprintType)
struct FMyStruct
{
GENERATED_BODY()
// 暴露給藍圖
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Test Variables")
int32 MyIntegerMemberVariable;
// 不暴露給藍圖
int32 NativeOnlyMemberVariable;
// 藍圖圖表無法訪問此UObject指針,但是指針對UE4的反射、智能指針和垃圾回收系統可見。
UPROPERTY()
UObject* SafeObjectPointer;
};
UPROPERTY(EditAnywhere,BlueprintReadWrite)
FMyStruct MyStruct;

- 繼承
FTableRowBase之后可以用於DataTable
struct FInventoryItemInfo : public FTableRowBase
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString ItemName UMETA(DisplayName="名稱");
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 index UMETA(DisplayName="編號");
UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool bCanStaking UMETA(DisplayName="可否疊加");
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 Count UMETA(DisplayName="數量");
UPROPERTY(EditAnywhere, BlueprintReadWrite)
UTexture2D* Icon UMETA(DisplayName="圖標");
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TSubclassOf<AActor> ItemClass;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
USkeletalMesh* SkeletalMesh;
};
UPROPERTY(EditAnywhere,BlueprintReadWrite)
FInventoryItemInfo EmptyItem;

參考
結構體