//基于结构体变量类型,创建数据表DataTable类型
USTRUCT(BlueprintType)
struct FMyDataTableStruct : public FTableRowBase //把结构体变量公开到数据表类型
{GENERATED_BODY() //必须添加“GENERATED_BODY()”UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="MyDataTable")FString Name;UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="MyDataTable")int32 Age;UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="MyDataTable")float Weight;
};
【制作技巧】
1.在UE5创建数据表后导出,再使用Text编辑并保存为UTF-8编码
*注意:第一列的“行命名”不能为空,一定要写入行号(数字、字母、文字均可),否则该行会丢失
2.点击刚新建的数据表“重新导入”,选择刚才的csv文件即可