先在UCLASS()前写入:
USTRUCT(BlueprintType)
struct FMyStruct //必须以"F"开头
{
GENERATED_BODY() //必须添加“GENERATED_BODY()”
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "MyStruct1")
int32 Health;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "MyStruct2")
FString Name;
};
【注意】这里实现了的Health、Name不同的Category名称
【注意】如果UPROPERTY不声明“BlueprintReadWrite, Category = “MyStruct1””,则Mystruct不能被中断,也不会显示属性引脚
然后在UCLASS()中写入:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "MyStruct")
FMyStruct MyStruct1;